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 LCG = (function () { | |
var c = 0x93456789, a = 0x169659, mod, mask, r; | |
mask = (mod = Math.pow(2, 31)) - 1; | |
function LCG(seed) { | |
this.seed = seed || new Date().getTime(); | |
} | |
LCG.prototype = { | |
nextInt: |
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
/* An HTML template in 180 bytes (minified) | |
Features: Escapes HTML, accepts either strings or functions as values, and that's all (it doesn't handle looping). | |
Usage: | |
OneEightyT( | |
"<h1>{name}</h1><div>{content} @ {currentTime}</div>", | |
{ | |
name: "Stella", |
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
javascript:(function(){ | |
var delay=60000, delay2=1000, intensity=0.0, timer, timer2, i=0; | |
function reset(){document.documentElement.setAttribute('style',''); clearTimeout(timer); clearTimeout(timer2); intensity = 0.0; i = 0; timer = setTimeout(blur, delay);} | |
function blur(){ | |
if(intensity<6){ | |
intensity+=0.5; | |
applyBlur(intensity); | |
timer2 = setTimeout(blur, delay2); | |
} | |
} |
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
// From http://www.jetbrains.com/phpstorm/marklets/ | |
// Start XDebug Debug Session | |
javascript:(function(){document.cookie='XDEBUG_SESSION='+'PHPSTORM'+';path=/;';})() | |
// Stop XDebug Debug Session | |
javascript:(function(){document.cookie='XDEBUG_SESSION='+''+';expires=Mon, 05 Jul 2000 00:00:00 GMT;path=/;';})() | |
// Debug Current Page | |
javascript:(function(){document.cookie='XDEBUG_SESSION='+'PHPSTORM'+';path=/;';document.location.reload();document.cookie='XDEBUG_SESSION='+''+';expires=Mon, 05 Jul 2000 00:00:00 GMT;path=/;';})() |
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
""" | |
preprocess-twitter.py | |
python preprocess-twitter.py "Some random text with #hashtags, @mentions and http://t.co/kdjfkdjf (links). :)" | |
Script for preprocessing tweets by Romain Paulus | |
with small modifications by Jeffrey Pennington | |
with translation to Python by Motoki Wu | |
Translation of Ruby script to create features for GloVe vectors for Twitter data. |
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 endianness () { | |
var b = new ArrayBuffer(4); | |
var a = new Uint32Array(b); | |
var c = new Uint8Array(b); | |
a[0] = 0xdeadbeef; | |
if (c[0] == 0xef) return 'LE'; | |
if (c[0] == 0xde) return 'BE'; | |
throw new Error('unknown endianness'); | |
} |
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
""" | |
preprocess-twitter.py | |
python preprocess-twitter.py "Some random text with #hashtags, @mentions and http://t.co/kdjfkdjf (links). :)" | |
Script for preprocessing tweets by Romain Paulus | |
with small modifications by Jeffrey Pennington | |
with translation to Python by Motoki Wu | |
Translation of Ruby script to create features for GloVe vectors for Twitter data. |
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
#!/usr/bin/env bash | |
# Check we've got command line arguments | |
if [ -z "$*" ] ; then | |
echo "Need to specify ssh options" | |
exit 1 | |
fi | |
# Start trying and retrying | |
((count = 100)) |
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 | |
# parse endpoint (only works for POST) | |
read request | |
url="${request#POST }" | |
url="${url% HTTP/*}" | |
# change this!!! | |
secret="top-secret" |
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 serialport = require('node-serialport') | |
var sp = new serialport.SerialPort("/dev/ttyO3", { | |
parser: serialport.parsers.raw, | |
baud: 9600 | |
}) | |
sp.on('data', function(chunk) { | |
console.log(chunk.toString('hex'), chunk.toString(), chunk) | |
}) |
OlderNewer