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
// traverse a given DOM Node and log it's children recursively | |
function logChildNodes(node){ | |
for (var c=0; c<node.childNodes.length; c++){ | |
if (node.childNodes[c].nodeName!='#text') | |
console.log(node.childNodes[c].nodeName+", "+node.childNodes[c].id) | |
if (node.hasChildNodes()) | |
logChildNodes(node.childNodes[c]) | |
} | |
} |
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
/********************************************** | |
* Simple Sketch Base for interactive Projects | |
* done in Processing http://processing.org | |
*********************************************/ | |
/** | |
* Declare your variables here: | |
*/ | |
int var; // For example |
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
// makes the font in the editors anti-alias: | |
editor.antialias=true | |
//sets the font for the editor on processing, e.g.: | |
editor.font=LMMonoLt10-Regular,plain,20 | |
// or platform specific | |
editor.font.macosx=LMMonoLt10-Regular,plain,20 | |
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
/* Make an Array with unique members */ | |
Array.prototype.unique = function(){ | |
return this.filter(function(){return arguments[2].indexOf(arguments[0],arguments[1]+1)<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
# for example ".bak" | |
TOKEN=.bak | |
ETOKEN=`echo $TOKEN |sed 's/\./\\\./'` | |
# any suggestions how to get rid of this "bash" at the end are appreciated | |
# also: alternatively there is a NOT opperator on sed's regex - not used here | |
find . -path "*$TOKEN" -d 1 |sed 's/^\.\(.*\)\($ETOKEN\)$/mv `pwd`\1\2 `pwd`\1/'|bash |
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
echo "hello world" > /dev/universe && exit |
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
// Given we need a list of things of the same type (our class "Rect") we should do: | |
ArrayList<Rect> listOfRects = new ArrayList(); | |
// then we can easily iterate over this list with: | |
for (Rect r : listOfRects) | |
{ | |
r.someFancyMethod(); | |
} |
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
/** | |
* A real quick shot for syntax highlighting via highlight.js on any page | |
* Unobtrusive, once loaded, anything goes. | |
* | |
* Version 0.0.1a, jens a. ewald, ififelse.net, www.muthesius.de, (cleft) 2011 | |
* | |
*/ | |
// the script | |
$.getScript('http://yandex.st/highlightjs/5.16/highlight.min.js',function(){ | |
// defautl language? |
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
/** | |
* My Program | |
*/ | |
void setup(){ | |
smooth(); | |
size(300,300); | |
} | |
void draw(){ |
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 | |
# ================================================================= | |
# = Update to the latest version fo chromium - fresh from the bot = | |
# = Based on a MacOS X Hint: = | |
# = http://hints.macworld.com/article.php?story=20090604081030791 = | |
# ================================================================= | |
echo "Updating to latest version of Chromium." |
OlderNewer