Skip to content

Instantly share code, notes, and snippets.

View jedahan's full-sized avatar
💀
.

Jonathan Dahan jedahan

💀
.
View GitHub Profile

Setting up any of the note listeners

create an instance with full access to compute and storage

export INSTANCE_NAME=some-test-instance-here


gcutil --project=$PROJECT addinstance $INSTANCE_NAME \
--service_account_scopes=compute-rw,storage-full \

--zone=us-central1-a \

var gpio = require("gpio");
var gpio4 = gpio.export(4, {
direction: "in",
ready: function() {
console.log('gpio has been exported');
}
});
var sockets = [];
<style>
body { background: #333355; }
body.connected { background: #620042; }
</style>
<script src="/socket.io/socket.io.js"></script>
<body>
<script>
var socket = io();
socket.on('change', function(val){
console.log('change ', val);
~/Dropbox/code/jedahan/jsmess master
❯ make
tail: illegal option -- -
usage: tail [-F | -f | -r] [-q] [-b # | -c # | -n #] [file ...]
makefile:233: warning: overriding commands for target `/Users/jedahan/Dropbox/code/jedahan/jsmess/build/'
makefile:230: warning: ignoring old commands for target `/Users/jedahan/Dropbox/code/jedahan/jsmess/build/'
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Linking obj/nativesdl64/build/file2str...
clang++ -arch x86_64 -m64 obj/nativesdl64/build/file2str.o obj/nativesdl64/libocore.a -lstdc++ -lpthread -framework CoreAudio -framework CoreMIDI -F/Library/Frameworks/ -framework SDL -framework Cocoa -framework OpenGL -lpthread -o obj/nativesdl64/build/file2str
ld: framework not found SDL
# ./video.sh [path_to_video] [path_to_this_screen_config]
video=$1
screen_config=$2
HOSTS='google.com reddit.com '
FOUND=''
until [ ${#HOSTS} -eq ${#FOUND} ]; do
FOUND=''
for host in $HOSTS; do
@jedahan
jedahan / index.html
Last active August 29, 2015 14:04 — forked from mbostock/.block
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.link {
fill: none;
stroke: #666;
stroke-width: 1.5px;
}
@jedahan
jedahan / README.md
Last active August 29, 2015 14:04 — forked from mbostock/.block

Click to add nodes! Nodes near the cursor will be linked to the new node.

D3's force layout uses the Barnes–Hut approximation to compute repulsive charge forces between all nodes efficiently. Links are implemented as geometric constraints on top of position Verlet integration, offering greater stability. A virtual spring between each node and the center of the chart prevents nodes from drifting into space.

❯ brew test --HEAD libtins
Testing libtins
==> cp -a /usr/local/Cellar/libtins/HEAD/share/doc/libtins/examples/* /private/tmp/libtins-t
cp: /usr/local/Cellar/libtins/HEAD/share/doc/libtins/examples/*: No such file or directory
Error: libtins: failed
Failed executing: cp -a /usr/local/Cellar/libtins/HEAD/share/doc/libtins/examples/* /private/tmp/libtins-txuv
/usr/local/Library/Homebrew/formula.rb:558:in `block in system'
/usr/local/Library/Homebrew/formula.rb:542:in `open'
/usr/local/Library/Homebrew/formula.rb:542:in `system'
/usr/local/Library/Formula/libtins.rb:22:in `block in <class:Libtins>'
volatile byte buttons;
volatile int buttons_read = 0;
volatile int frame = 0;
void setup() {
pinMode(A2, OUTPUT);
noInterrupts();
bitSet(EICRA, ISC01); // rising edge interrupts
bitSet(EIMSK, INT0); // on interrupt 0 (pin 2)
volatile byte buttons;
volatile byte buttons_read = 0;
volatile byte frame = 0;
void setup() {
pinMode(A2, OUTPUT);
cli();
bitSet(EICRA, ISC01); // rising edge interrupts
bitSet(EIMSK, INT0); // on interrupt 0 (pin 2)