Skip to content

Instantly share code, notes, and snippets.

@jlamendo
jlamendo / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jlamendo
jlamendo / xcodeEula.sh
Last active August 29, 2015 14:10
Xcode Eula Auto Accept
#!/usr/bin/expect
set timeout 5
spawn sudo xcodebuild -license
expect {
"By typing 'agree' you are agreeing to the terms of the software license agreements." {
send "agree\r\n";
}
"Software License Agreements Press 'space' for more, or 'q' to quit" {
send " ";
exp_continue;
var levelup = require('levelup');
var db = levelup('./users.db');
var Iron = require('iron');
var config = require('config');
var secret="reallybadsecret";
db.put('student', JSON.stringify({
username: 'student',
password: 'student'
}), function(err) {
@jlamendo
jlamendo / fuzz
Last active August 29, 2015 14:04
Tiny Fuzz String Generator in pure JS.
(function(){var b=new function(){this.l=[255,256,257,420,511,512,1023,1024,2047,2048,4096,4097,5E3,1E4,2E4,3E4,32762,32763,32764,32765,32766,32767,32768,4E4,65534,65535,65536];this.m="A %x %n %s %s%n%x%d %99999999999s %99999999999d %99999999999x %99999999999n %08x %%20s %%20x %%20n %%20d".split(" ");this.s="%.1024d %.2048d %.4096d %.8200d %99999999999s %99999999999d %99999999999x %99999999999n %#0123456x%08x%x%s%p%n%d%o%u%c%h%l%q%j%z%Z%t%i%e%g%f%a%C%S%08x%%#0123456x%%x%%s%%p%%n%%d%%o%%u%%c%%h%%l%%q%%j%%z%%Z%%t%%i%%e%%g%%f%%a%%C%%S%%08x".split(" ");
this.f=this.s.length+this.m.length;this.g=function(a){return a<=this.m.length?Array(this.l[Math.floor(Math.random()*this.l.length)]).join(this.m[a]):this.s[a]};this.fz=function(){return this.g(Math.floor(Math.random()*this.f))}};return function(){return b.fz()}})();