snipt

Ctrl+h for KB shortcuts

HTML

Javascript: close window

1
2
3
<div onClick="javascript:window.close();">
    CLOSE WINDOW
</div>
https://snipt.net/embed/c6d7468a5cc402de6678671ca5f2b783/
https://snipt.net/raw/c6d7468a5cc402de6678671ca5f2b783/
c6d7468a5cc402de6678671ca5f2b783
html
HTML
4
2016-09-21T22:14:12
True
False
True
Oct 17, 2015 at 07:08 AM
/api/public/snipt/141762/
javascript-close-window
<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 id="L-1"><a name="L-1"></a><span class="nt">&lt;div</span> <span class="na">onClick=</span><span class="s">&quot;javascript:window.close();&quot;</span><span class="nt">&gt;</span> </span><span id="L-2"><a name="L-2"></a> CLOSE WINDOW </span><span id="L-3"><a name="L-3"></a><span class="nt">&lt;/div&gt;</span> </span></pre></div> </td></tr></table>
How, Javascript, a, close, in, to, windows

Text only

run mkswap on any swap partitions in /etc/fstab

1
2
3
4
5
AWK en mkswap on 
http://tldp.org/HOWTO/Linux+FreeBSD-3.html
awk -- '/swap/ && ($1 !~ /#/) { system("mkswap "$1"") }' /etc/fstab

This will run mkswap on any swap partitions in /etc/fstab every time you boot except if they are commented out (having ``#'' as the first character in the line.)
https://snipt.net/embed/38a4daca649d69f6d4ac56fa3f097c03/
https://snipt.net/raw/38a4daca649d69f6d4ac56fa3f097c03/
38a4daca649d69f6d4ac56fa3f097c03
text
Text only
6
2016-09-22T18:00:28
True
False
False
/api/public/snipt/10348/
run-mkswap-on-any-swap-partitions-in-etcfstab
<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> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>AWK en mkswap on </span><span id="L-2"><a name="L-2"></a>http://tldp.org/HOWTO/Linux+FreeBSD-3.html </span><span id="L-3"><a name="L-3"></a>awk -- &#39;/swap/ &amp;&amp; ($1 !~ /#/) { system(&quot;mkswap &quot;$1&quot;&quot;) }&#39; /etc/fstab </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>This will run mkswap on any swap partitions in /etc/fstab every time you boot except if they are commented out (having ``#&#39;&#39; as the first character in the line.) </span></pre></div> </td></tr></table>
/etc/fstab, any, in, mkswap, on, partitions, run, swap

Java

Hello World in Java

1
2
3
4
5
6
7
// Hello World in Java

class HelloWorld {
  static public void main( String args[] ) {
    System.out.println( "Hello World!" );
  }
}
https://snipt.net/embed/4e97a39a7cd6d5558d41bb0fe6bbb073/
https://snipt.net/raw/4e97a39a7cd6d5558d41bb0fe6bbb073/
4e97a39a7cd6d5558d41bb0fe6bbb073
java
Java
8
2016-09-23T12:51:36
True
False
False
/api/public/snipt/1477/
hello-world-in-java
<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> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="c1">// Hello World in Java</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="kd">class</span> <span class="nc">HelloWorld</span> <span class="o">{</span> </span><span id="L-4"><a name="L-4"></a> <span class="kd">static</span> <span class="kd">public</span> <span class="kt">void</span> <span class="nf">main</span><span class="o">(</span> <span class="n">String</span> <span class="n">args</span><span class="o">[]</span> <span class="o">)</span> <span class="o">{</span> </span><span id="L-5"><a name="L-5"></a> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span> <span class="s">&quot;Hello World!&quot;</span> <span class="o">);</span> </span><span id="L-6"><a name="L-6"></a> <span class="o">}</span> </span><span id="L-7"><a name="L-7"></a><span class="o">}</span> </span></pre></div> </td></tr></table>
hello, in, java, world
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.