Skip to content

Instantly share code, notes, and snippets.

View jonpacker's full-sized avatar

Jon Packer jonpacker

View GitHub Profile
test q23
@jonpacker
jonpacker / result
Created November 14, 2011 14:36
Weird selector behaviour in jsdom
Tysfjord:repub jonpacker$ coffee testpage_test
QuerySelector: 6
jQuery: 3
@jonpacker
jonpacker / a.coffee
Created November 27, 2011 06:52 — forked from tomdale/a.coffee
SC.Object.extend
name: SC.attr 'string', { option: 'foo' }
//
// SecondViewController.m
// c8h10n4o2
//
// Created by Håkon Sørensen on 10.11.11.
// Copyright (c) 2011 SorensenWeb. All rights reserved.
//
#import "SecondViewController.h"
#import "ASIHTTPRequest.h"
@jonpacker
jonpacker / gist:2107554
Created March 19, 2012 10:59
Force unmount a nonresponsive SSHFS
kill -9 <sshfs pid>
fusermount -u <mountpoint>
@jonpacker
jonpacker / gist:2133606
Created March 20, 2012 09:53
Single user ftp

Install vsftpd

/etc/vsftpd.conf

anonymous_enable=NO
local_enable=YES
userlist_enable=YES
userlist_deny=NO
userlist_file=/etc/vsftpd.user_list

/etc/vsftpd.user_list

@jonpacker
jonpacker / cooking.js
Created May 5, 2012 22:06
Making a meal for Helge
var naan = require('naan');
var fs = require('fs');
// With naan.cook:
var makeHelgesMeal = naan.cook(
naan.curry(fs.writeFile, "bobby"),
naan.curry(fs.readFile, "bob")
);
makeHelgesMeal(function(err) {});
function join() {
return [].join.call(arguments);
}
var readFooFile = naan.curry(fs.readFile, "foo.txt", "utf8");
var readBarFile = naan.curry(fs.readFile, "bar.txt", "utf8");
// readFooFile and readBarFile now take one argument, the callback, and
@jonpacker
jonpacker / vanilla.js
Created June 15, 2012 11:05
Solving callback soup with async.js
var refreshDb = function(done) {
spawn(neo4j, ['stop']).on('exit', function() {
spawn('rm', ['-rf', datapath]).on('exit', function() {
spawn('mkdir', ['-p', datapath]).on('exit', function() {
updateConf(TEST_INSTANCE_PORT, function() {
var n = spawn(neo4j, ['start'])
n.stdout.on('data', function(d) {
process.stdout.write(d.toString());
})
n.on('exit', function() {
@jonpacker
jonpacker / gist:3687203
Created September 9, 2012 20:50
Monadic Juleøl
Monadic Juleøl - Old Ale
================================================================================
Batch Size: 19.000 L
Boil Size: 22.076 L
Boil Time: 60.000 min
Efficiency: 70%%
OG: 1.078
FG: 1.019
ABV: 7.6%%
Bitterness: 53.8 IBUs (Tinseth)