Skip to content

Instantly share code, notes, and snippets.

View teburd's full-sized avatar

Tom Burdick teburd

View GitHub Profile
From 2f82e47a8e0da8cb28c9d2602169dcbdcc729518 Mon Sep 17 00:00:00 2001
From: Tom Burdick <thomas.burdick@gmail.com>
Date: Fri, 25 Mar 2011 21:31:55 -0500
Subject: [PATCH 1/2] fixed erlang pkgbuild file
---
erlang/PKGBUILD | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/erlang/PKGBUILD b/erlang/PKGBUILD
@teburd
teburd / cookiemonster
Created April 6, 2011 15:49
cookiemonster
<!DOCTYPE html>
<html>
<head>
<script type="application/javascript">
function cookieMonster() {
var prefix = "whatever_man_biiiiiiiiiiiig_cookie_me_want_";
for(i = 0; i < 100; i++)
{
var date = new Date();
document.cookie = document.cookie + prefix + i + "=" + date + ";";
=SUPERVISOR REPORT==== 6-Apr-2011::10:47:44 ===
Supervisor: {<0.77.0>,cowboy_requests_sup}
Context: child_terminated
Reason: {function_clause,
[{cowboy_http_protocol,header,
[{http_error,
"iiiiiiiiig_cookie_me_want_17=Wed Apr 06 2011 10:38:52 GMT-0500 (CDT)whatever_man_biiiiiiiiiiiig_cookie_me_want_18=Wed Apr 06 2011 10:38:52 GMT-0500 (CDT)whatever_man_biiiiiiiiiiiig_cookie_me_want_19=Wed Apr 06 2011 10:38:52 GMT-0500 (CDT)whatever_man_biiiiiiiiiiiig_cookie_me_want_20=Wed Apr 06 2011 10:38:52 GMT-0500 (CDT)whatever_man_biiiiiiiiiiiig_cookie_me_want_21=Wed Apr 06 2011 10:38:52 GMT-0500 (CDT)whatever_man_biiiiiiiiiiiig_cookie_me_want_22=Wed Apr 06 2011 10:38:52 GMT-0500 (CDT)whatever_man_biiiiiiiiiiiig_cookie_me_want_23=Wed Apr 06 2011 10:38:52 GMT-0500 (CDT)whatever_man_biiiiiiiiiiiig_cookie_me_want_24=Wed Apr 06 2011 10:38:52 GMT-0500 (CDT)whatever_man_biiiiiiiiiiiig_cookie_me_want_25=Wed Apr 06 2011 10:38:52 G
@teburd
teburd / gist:1070008
Created July 7, 2011 17:10
Riak Fails Me
$ ./bin/riak start
Riak failed to start within 15 seconds.
If you want to wait longer, set the environment variable
WAIT_FOR_ERLANG to the number of seconds to wait.
@teburd
teburd / gist:1070010
Created July 7, 2011 17:12
Riak Fails Me (more stuff)
$ ./bin/riak console
Exec: /home/tburdick/development/riak/dev/dev1/erts-5.8.4/bin/erlexec -boot /home/tburdick/development/riak/dev/dev1/releases/0.14.2/riak -embedded -config /home/tburdick/development/riak/dev/dev1/etc/app.config -args_file /home/tburdick/development/riak/dev/dev1/etc/vm.args -- console
Root: /home/tburdick/development/riak/dev/dev1
Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:64] [hipe] [kernel-poll:true]
/home/tburdick/development/riak/dev/dev1/lib/os_mon-2.2.6/priv/bin/memsup: Erlang has closed.
Erlang has closed
=INFO REPORT==== 7-Jul-2011::12:11:33 ===
application: webmachine
@teburd
teburd / gist:1070027
Created July 7, 2011 17:16
Build Failure
Compiling c_src/spidermonkey_drv.c
/usr/bin/ld: i386 architecture of input file `c_src/system/lib/libnspr4.a(prtpd.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `c_src/system/lib/libnspr4.a(prmem.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `c_src/system/lib/libnspr4.a(pratom.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `c_src/system/lib/libnspr4.a(prerror.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `c_src/system/lib/libnspr4.a(prinit.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `c_src/system/lib/libnspr4.a(prinrval.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `c_src/system/lib/libnspr4.a(prnetdb.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `c_src/system/lib/libnspr4.a(prtime.o)' is incompatible with i386:x
@teburd
teburd / cowboy_http_rest.erl
Created July 14, 2011 05:20
Cowboy HTTP REST
-module(cowboy_http_rest).
-export([]).
-record(state, {
res,
res_state,
content_types_provided,
content_type_accepted
}).
@teburd
teburd / data_validation.erl
Created July 15, 2011 18:20
Erlang Data Validation
%% @author Tom Burdick <tburdick@wrightwoodtech.com>
%% @doc Data Validation.
-module(data_validation).
%% api
-export([parse/1, validate/2, has_errors/1, errors/1, values/1]).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
@teburd
teburd / cowboy_static_handler.erl
Created July 30, 2011 14:17
Partially Done Cowboy Static File Handler
%% @author Tom Burdick <thomas.burdick@gmail.com>
%% @doc Static File Cowboy Handler.
-module(cowboy_static_handler).
-behaviour(cowboy_http_handler).
%% cowboy_http_handler api
-export([init/3, handle/2, terminate/2]).
@teburd
teburd / gist:1256317
Created October 1, 2011 16:54
Sine Wave Points
%% @doc Generate a set of points representing a sine wave
%% given some parameters (position, points to generate, freqency, amplitude,
%% offset, sample rate).
%% @end
sine(X, N=0, Frequency, Amplitude, Offset, SampleRate)
when is_integer(X), is_integer(N), is_float(Frequency),
is_float(Amplitude), is_float(Offset), is_float(SampleRate)->
[];
sine(X, N, Frequency, Amplitude, Offset, SampleRate)
when is_integer(X), is_integer(N), is_float(Frequency),