Skip to content

Instantly share code, notes, and snippets.

View janpieper's full-sized avatar
😎
Whoop Whoop \o/

Jan Pieper janpieper

😎
Whoop Whoop \o/
View GitHub Profile
var resourcer = require("resourcer");
resourcer.connect({
port: 5984,
uri: "database://website"
});
exports.Account = resourcer.define("account", function() {
this.property("type");
this.property("name");
@janpieper
janpieper / nodecamp.eu-talks-2011.md
Created June 14, 2011 06:57 — forked from fhemberger/nodecamp.eu-talks-2011.md
A collection of talks and presentations held at nodecamp.eu 2011
@janpieper
janpieper / fliplife-referer-bug.php
Created November 17, 2011 22:50
Small script to check if the Referer-bug is still existent at fliplife.com
<?php
/**
* Send HTTP request to "fliplife.com" and return the HTTP status.
*
* @param array $headers Associative array with HTTP request headers.
* @throws Exception If no HTTP status can be found.
* @return integer HTTP status.
*/
function requestFliplife(array $headers)
/*
* jQuery Plugin: Tokenizing Autocomplete Text Entry
* Version 1.6.0
*
* Copyright (c) 2009 James Smith (http://loopj.com)
* Licensed jointly under the GPL and MIT licenses,
* choose which one suits your project best!
*
*/
@janpieper
janpieper / mix.exs
Created July 30, 2013 08:35
Elixir: {:noproc, {:gen_server, :call, [Mix.Server, :env, 30000]}}
$ elixir -v
Elixir 0.10.0
$ erl
Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V5.10.2 (abort with ^G)
1>
@janpieper
janpieper / gist:6111302
Created July 30, 2013 08:42
Elixir: iex --erl "-boot start_sasl" --sname a --cookie dummy -S mix
$ iex --erl "-boot start_sasl" --sname a --cookie dummy -S mix
Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
=PROGRESS REPORT==== 30-Jul-2013::10:41:03 ===
supervisor: {local,sasl_safe_sup}
started: [{pid,<0.42.0>},
{name,alarm_handler},
{mfargs,{alarm_handler,start_link,[]}},
@janpieper
janpieper / gist:6111303
Created July 30, 2013 08:42
Elixir: iex --erl "-boot start_sasl" --sname a --cookie dummy -S mix
$ iex --erl "-boot start_sasl" --sname a --cookie dummy -S mix
Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
=PROGRESS REPORT==== 30-Jul-2013::10:41:03 ===
supervisor: {local,sasl_safe_sup}
started: [{pid,<0.42.0>},
{name,alarm_handler},
{mfargs,{alarm_handler,start_link,[]}},
@janpieper
janpieper / couchdb.sh
Created August 13, 2013 09:40
My CouchDB Installation (1.2.2)
#!/bin/sh -e
#
# Original File Location:
# /etc/init.d/couchdb
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
@janpieper
janpieper / read-from-file.js
Created October 15, 2013 16:10
rm /tmp/foo && touch /tmp/foo
var fs = require("fs");
function read(fd) {
var buf = new Buffer(8);
fs.read(fd, buf, 0, buf.length, null, function () {
console.log(buf);
read(fd);
});
}
@janpieper
janpieper / bar.js
Created October 16, 2013 12:20
Can't catch thrown Error
var util = require("util")
, fs = require("fs");
exports.create = function () {
var b = new Bar();
b.bla();
};
var Bar = function () {};