snipt

Ctrl+h for KB shortcuts

Java

24

1
2
3
4
5
6
class Example
{
public static void main(Strings args[])
{
    System.out.println();
}
https://snipt.net/embed/221b15cb6ec1747e11f851b93cb462c1/
https://snipt.net/raw/221b15cb6ec1747e11f851b93cb462c1/
221b15cb6ec1747e11f851b93cb462c1
java
Java
7
2016-09-22T14:13:22
True
False
True
Mar 11, 2014 at 02:03 PM
/api/public/snipt/120984/
-13931
<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></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="kd">class</span> <span class="nc">Example</span> </span><span id="L-2"><a name="L-2"></a><span class="o">{</span> </span><span id="L-3"><a name="L-3"></a><span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="o">(</span><span class="n">Strings</span> <span class="n">args</span><span class="o">[])</span> </span><span id="L-4"><a name="L-4"></a><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><span id="L-6"><a name="L-6"></a><span class="o">}</span> </span></pre></div> </td></tr></table>
example, simple

Text only

html 5 canvas example

1
2
3
4
5
6
7
var drawingCanvas = document.getElementById(‘myDrawing’);
// Check the element is in the DOM and the browser supports canvas
if(drawingCanvas.getContext) {
// Initaliase a 2-dimensional drawing context
var context = drawingCanvas.getContext(’2d’);
//Canvas commands go here
}
https://snipt.net/embed/cc26308c81fbf157d3a6c487882696ce/
https://snipt.net/raw/cc26308c81fbf157d3a6c487882696ce/
cc26308c81fbf157d3a6c487882696ce
text
Text only
7
2016-09-21T13:54:34
True
False
False
/api/public/snipt/25982/
html-5-canvas-example
<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>var drawingCanvas = document.getElementById(‘myDrawing’); </span><span id="L-2"><a name="L-2"></a>// Check the element is in the DOM and the browser supports canvas </span><span id="L-3"><a name="L-3"></a>if(drawingCanvas.getContext) { </span><span id="L-4"><a name="L-4"></a>// Initaliase a 2-dimensional drawing context </span><span id="L-5"><a name="L-5"></a>var context = drawingCanvas.getContext(’2d’); </span><span id="L-6"><a name="L-6"></a>//Canvas commands go here </span><span id="L-7"><a name="L-7"></a>} </span></pre></div> </td></tr></table>
5, canvas, example, html

Smalltalk

One of my most-hated standard smalltalk methods

fail
	^self assert: false
https://snipt.net/embed/97357f83413b988a1310c65fea2e842d/
https://snipt.net/raw/97357f83413b988a1310c65fea2e842d/
97357f83413b988a1310c65fea2e842d
smalltalk
Smalltalk
2
2016-09-21T13:55:03
True
False
False
/api/public/snipt/19467/
one-of-my-most-hated-standard-smalltalk-methods
<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 id="L-1"><a name="L-1"></a><span class="nf">fail</span> </span><span id="L-2"><a name="L-2"></a> <span class="o">^</span><span class="bp">self</span> <span class="nf">assert:</span> <span class="bp">false</span> </span></pre></div> </td></tr></table>
bad, example
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.