This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 // a geometry vertice | |
2 struct Vertice { | |
3 1: double x, | |
4 2: double y, | |
5 3: double z | |
6 } | |
7 | |
8 // geometry itself | |
9 struct Geometry { | |
10 1: list<Vertice> vertices |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Point(x, y) { | |
this.x = x; | |
this.y = y; | |
return this; | |
} | |
var a = [ | |
new Point(0, 3) | |
, new Point(1, 1) | |
, new Point(1, 3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Sample { | |
public int bar; | |
public void foo() { | |
#StarTrek SomeShittyLog4jLogger.info | |
if (bar == 1998) { | |
System.out.println("Google"); | |
} else { | |
bar = 1998; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
bar=0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var vm = require('vm') | |
, fs = require('fs') | |
CodeMirror = require('./runmode.node.js'); | |
var text = fs.readFileSync("./javascript.js", "utf-8"); | |
vm.runInThisContext(text); | |
CodeMirror.runMode("var i = 0;", "text/javascript", function() { | |
console.log(arguments); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generatePalette() | |
{ | |
// example of test input | |
var fontsPalette = { | |
"Times New Roman": "", | |
"Arial": "", | |
"Verdana": "" | |
}; | |
var fonts = Object.keys(fontsPalette); | |
var amount = Object.keys(fonts).length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var magic = 10000026136623930; | |
console.log(magic % 2 === 0); // true | |
console.log((magic + 1) % 2 === 0); // true... WHAT | |
// See http://www.2ality.com/2013/10/safe-integers.html | |
// to figure out what's going on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
function copyFiles | |
{ | |
cd $downstreamFolder | |
for file in *.*; do | |
fileName=$(basename $file) | |
if [[ $fileName == $generatedFile ]]; then | |
continue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var editor = new CodeMirror({ /* ... */ }); | |
fake(editor, "("); // if you have closebrackets.js addon switched on, this will actually generate "()" | |
fake(editor, "enter"); // all the crazy indenting logic will be used | |
fake(editor, "e"); // just letter "e" | |
fake(editor, 48); // 0 | |
fake(editor, "leftArrow", ["ctrlKey", "shiftKey"]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
if (( $# < 1 )); then | |
echo "Specify filename to analyze" | |
exit 1 | |
fi | |
fileName=$1 |
OlderNewer