Skip to content

Instantly share code, notes, and snippets.

View jonpacker's full-sized avatar

Jon Packer jonpacker

View GitHub Profile
@jonpacker
jonpacker / gist:4131368
Created November 22, 2012 14:10
shit that has broken in windows
* network services pane does not acknowledge connection to network. browsing the internet still works.
* changing settings on control panel dont's save after clicking 'save'. go back after saving and they are immediately reverted.
* file updates in visual studio only work if you edit the file inside visual studio.
* ftp server set up. does not respond to requests from other computers on the network. no firewall. no ip blocking. just doesn't work.
@jonpacker
jonpacker / gist:3949458
Created October 24, 2012 22:55
monadic wit
Monadic Wit
================================================================================
Batch Size: 27.000 L
Boil Size: 25.076 L
Boil Time: 60.000 min
Efficiency: 70%%
OG: 1.054
FG: 1.013
ABV: 5.4%%
Bitterness: 19.9 IBUs (Tinseth)
@jonpacker
jonpacker / JPEventedBase.h
Created October 4, 2012 05:16
Event base class for objective c
#import <Foundation/Foundation.h>
// I did not steal this from Node.js. I promise. No way. Would never do that. Definitely not. Ok I did. Shut up.
typedef void (^JPEventBlock)(NSError* errorOrNil, id accompanyingDataOrNil);
@interface JPEventedObject : NSObject {
@private
NSMutableDictionary* _listeners;
}
Pacific - American Pale Ale
================================================================================
Batch Size: 30.000 L
Boil Size: 27.000 L
Boil Time: 60.000 min
Efficiency: 70%%
OG: 1.046
FG: 1.012
ABV: 4.5%%
Bitterness: 27.2 IBUs (Tinseth)
@jonpacker
jonpacker / beer.xml
Created September 11, 2012 13:26
HELGES MEGA JULEIPA
<?xml version="1.0" encoding="UTF-8"?>
<!--BeerXML generated by brewtarget-->
<RECIPES>
<RECIPE>
<NAME>HELGES MEGA BEER</NAME>
<VERSION>1</VERSION>
<TYPE>All Grain</TYPE>
<STYLE>
<NAME>Imperial IPA</NAME>
<VERSION>1</VERSION>
@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)
@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() {
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 / 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) {});
@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