snipt

Ctrl+h for KB shortcuts

Bash

apt-get resolve gpg keys

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $KEY
https://snipt.net/embed/fe6c97954927fe10fad29180c13cbf77/
/raw/fe6c97954927fe10fad29180c13cbf77/
fe6c97954927fe10fad29180c13cbf77
bash
Bash
2
2019-08-20T09:19:32
True
False
False
/api/public/snipt/20155/
apt-get-resolve-gpg-keys
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <span class="nv">$KEY</span> </span></pre></div> </td></tr></table>
apt-get, debian, gpg, keys, ubuntu

PHP

zend partial

<?=$this->partial('controller/partials/name.phtml', 'module', array('object'=> $object)); ?>
https://snipt.net/embed/9c83952373b4abe288c6916015a41631/
/raw/9c83952373b4abe288c6916015a41631/
9c83952373b4abe288c6916015a41631
php
PHP
1
2019-08-19T21:08:03
True
False
False
/api/public/snipt/18128/
zend-partial
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?</span><span class="o">=</span><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">partial</span><span class="p">(</span><span class="s1">&#39;controller/partials/name.phtml&#39;</span><span class="p">,</span> <span class="s1">&#39;module&#39;</span><span class="p">,</span> <span class="k">array</span><span class="p">(</span><span class="s1">&#39;object&#39;</span><span class="o">=&gt;</span> <span class="nv">$object</span><span class="p">));</span> <span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
partial, template, view, zend

PHP

Logging in Zend

1
2
3
4
<?php
Zend_Registry::get('_LOGGER')->debug($text);
Zend_Registry::get('_LOGGER')->debug(print_r($array, true));
?>
https://snipt.net/embed/0ee4f191bb5f9ae095b1a26af3a09cca/
/raw/0ee4f191bb5f9ae095b1a26af3a09cca/
0ee4f191bb5f9ae095b1a26af3a09cca
php
PHP
4
2019-08-20T08:15:24
True
False
False
/api/public/snipt/17261/
logging-in-zend
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a><span class="nx">Zend_Registry</span><span class="o">::</span><span class="na">get</span><span class="p">(</span><span class="s1">&#39;_LOGGER&#39;</span><span class="p">)</span><span class="o">-&gt;</span><span class="na">debug</span><span class="p">(</span><span class="nv">$text</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a><span class="nx">Zend_Registry</span><span class="o">::</span><span class="na">get</span><span class="p">(</span><span class="s1">&#39;_LOGGER&#39;</span><span class="p">)</span><span class="o">-&gt;</span><span class="na">debug</span><span class="p">(</span><span class="nb">print_r</span><span class="p">(</span><span class="nv">$array</span><span class="p">,</span> <span class="k">true</span><span class="p">));</span> </span><span id="L-4"><a name="L-4"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
logging, zend

CSS

fixing ie png alpha issue

filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/path/to/image.png', sizingMethod='image');
https://snipt.net/embed/9fc8c1b68d88b9a350fa1f58694edb3d/
/raw/9fc8c1b68d88b9a350fa1f58694edb3d/
9fc8c1b68d88b9a350fa1f58694edb3d
css
CSS
1
2019-08-20T01:39:03
True
False
False
/api/public/snipt/6883/
fixing-ie-png-alpha-issue
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nt">filter</span><span class="nd">:progid:DXImageTransform</span><span class="nc">.Microsoft.AlphaImageLoader</span><span class="o">(</span><span class="nt">src</span><span class="o">=</span><span class="s1">&#39;/path/to/image.png&#39;</span><span class="o">,</span> <span class="nt">sizingMethod</span><span class="o">=</span><span class="s1">&#39;image&#39;</span><span class="o">);</span> </span></pre></div> </td></tr></table>
alpha, ie, ie6, png

JavaScript

not funny comments 1

var aIDs = {...};
//if(aIDs.isInfected()){ die(); }
https://snipt.net/embed/1609d5a9dedb03af769751861410622c/
/raw/1609d5a9dedb03af769751861410622c/
1609d5a9dedb03af769751861410622c
js
JavaScript
2
2019-08-15T12:01:35
True
False
False
/api/public/snipt/6259/
funny-comments-1
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="kd">var</span> <span class="nx">aIDs</span> <span class="o">=</span> <span class="p">{...};</span> </span><span id="L-2"><a name="L-2"></a><span class="c1">//if(aIDs.isInfected()){ die(); }</span> </span></pre></div> </td></tr></table>
"no fun", "not funny", aids, comment, js

Java

str2int

1
2
3
4
// Konvertiert String zu int
public static int str2int(String sIn){
    return Integer.valueOf(sIn).intValue();
}
https://snipt.net/embed/5123468df6785111048b0259e63820e7/
/raw/5123468df6785111048b0259e63820e7/
5123468df6785111048b0259e63820e7
java
Java
4
2019-08-20T02:44:12
True
False
False
/api/public/snipt/6153/
str2int
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1">// Konvertiert String zu int</span> </span><span id="L-2"><a name="L-2"></a><span class="kd">public</span> <span class="kd">static</span> <span class="kt">int</span> <span class="nf">str2int</span><span class="o">(</span><span class="n">String</span> <span class="n">sIn</span><span class="o">){</span> </span><span id="L-3"><a name="L-3"></a> <span class="k">return</span> <span class="n">Integer</span><span class="o">.</span><span class="na">valueOf</span><span class="o">(</span><span class="n">sIn</span><span class="o">).</span><span class="na">intValue</span><span class="o">();</span> </span><span id="L-4"><a name="L-4"></a><span class="o">}</span> </span></pre></div> </td></tr></table>
java, str2int

JavaScript

lazy create Element + Prototype IE fix

1
2
3
function $N(sTag){
    return $(document.createElement(sTag));
}
https://snipt.net/embed/96d3465d1b9c3f750a37ac1d214d4e5f/
/raw/96d3465d1b9c3f750a37ac1d214d4e5f/
96d3465d1b9c3f750a37ac1d214d4e5f
js
JavaScript
3
2019-08-16T13:52:23
True
False
False
/api/public/snipt/6063/
lazy-create-element-prototype-ie-fix
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="kd">function</span> <span class="nx">$N</span><span class="p">(</span><span class="nx">sTag</span><span class="p">){</span> </span><span id="L-2"><a name="L-2"></a> <span class="k">return</span> <span class="nx">$</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="nx">sTag</span><span class="p">));</span> </span><span id="L-3"><a name="L-3"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
js, prototype

HTML

IE Special Comment Tag

<p>This is <comment>not</comment> Internet Explorer.</p>
https://snipt.net/embed/57799946e59654e0d7da9f6c0159264a/
/raw/57799946e59654e0d7da9f6c0159264a/
57799946e59654e0d7da9f6c0159264a
html
HTML
2
2019-08-18T23:28:33
True
False
False
/api/public/snipt/5830/
ie-special-comment-tag
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="p">&lt;</span><span class="nt">p</span><span class="p">&gt;</span>This is <span class="p">&lt;</span><span class="nt">comment</span><span class="p">&gt;</span>not<span class="p">&lt;/</span><span class="nt">comment</span><span class="p">&gt;</span> Internet Explorer.<span class="p">&lt;/</span><span class="nt">p</span><span class="p">&gt;</span> </span></pre></div> </td></tr></table>
"ie 6", comment, html, ie

HTML

IE Special Comment

1
2
3
<!--[if IE 6]>
Special instructions for IE 6 here
<![endif]-->
https://snipt.net/embed/b7db474ed3298de38b0a9a418f085670/
/raw/b7db474ed3298de38b0a9a418f085670/
b7db474ed3298de38b0a9a418f085670
html
HTML
4
2019-08-14T10:57:08
True
False
False
/api/public/snipt/5829/
ie-special-comment
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c">&lt;!--[if IE 6]&gt;</span> </span><span id="L-2"><a name="L-2"></a><span class="c">Special instructions for IE 6 here</span> </span><span id="L-3"><a name="L-3"></a><span class="c">&lt;![endif]--&gt;</span> </span></pre></div> </td></tr></table>
"ie 6", comment, html, ie