Skip to content

Instantly share code, notes, and snippets.

View ralphtheninja's full-sized avatar
🏠
Working from home

ralphtheninja

🏠
Working from home
View GitHub Profile
@ralphtheninja
ralphtheninja / backbone.htm
Created May 1, 2012 22:05 — forked from JasonMore/backbone.htm
Backbone.js TODO app implemented in knockout.js
<!DOCTYPE html>
<html lang="en">
<head>
<title>Backbone.js Todos</title>
<link rel="stylesheet" href="todos.css"/>
</head>
<body>
@ralphtheninja
ralphtheninja / node-and-npm-in-30-seconds.sh
Created May 6, 2012 22:09 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl http://npmjs.org/install.sh | sh
@ralphtheninja
ralphtheninja / gist:2624835
Created May 6, 2012 22:32
Panda On Motorcycle
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>
Panda Catch
</title>
<style>
canvas {
border:1px solid silver;
@ralphtheninja
ralphtheninja / nginx.conf
Created August 11, 2012 15:28 — forked from turtlesoupy/nginx.conf
node.js upstream nginx config
http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;
@ralphtheninja
ralphtheninja / LICENSE.txt
Created August 14, 2012 15:25 — forked from aemkei/LICENSE.txt
Lorenz Attractor - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@ralphtheninja
ralphtheninja / gist:3868236
Created October 10, 2012 20:32
node.js and http CONNECT method
var http = require('http');
var server = http.createServer(function(req, res) {
res.writeHead(200, {
'Content-type': 'application/json'
});
res.end(JSON.stringify(http.STATUS_CODES));
}).listen(4000);
server.on('connect', function(req, socket, head) {
@ralphtheninja
ralphtheninja / couchdb.log
Created October 17, 2012 08:41
CouchDB error when replicating
[Wed, 17 Oct 2012 08:38:45 GMT] [error] [<0.9425.0>] {error_report,<0.6443.0>,
{<0.9425.0>,crash_report,
[[{initial_call,{couch_rep,init,['Argument__1']}},
{pid,<0.9425.0>},
{registered_name,[]},
{error_info,
{exit,
{badarg,
[{erlang,list_to_existing_atom,["data_size"]},
{couch_rep,'-dbinfo/1-lc$^0/1-0-',1},
@ralphtheninja
ralphtheninja / gist:4357616
Created December 22, 2012 05:29
compile error for dtrace-for-linux on ubuntu
cd cmd/dtrace ; make --no-print-directory
cd cmd/ctfconvert ; make --no-print-directory
gcc -g -I. -I../../ -I../../libctf -I../../common -I../../uts/common -I../../linux -I/usr/include/libdwarf -o ../../build/ctfconvert ../../build/ctfconvert.obj/ctfconvert.o ../../build/ctfconvert.obj/alist.o ../../build/ctfconvert.obj/ctf.o ../../build/ctfconvert.obj/dwarf.o ../../build/ctfconvert.obj/hash.o ../../build/ctfconvert.obj/iidesc.o ../../build/ctfconvert.obj/input.o ../../build/ctfconvert.obj/list.o ../../build/ctfconvert.obj/memory.o ../../build/ctfconvert.obj/merge.o ../../build/ctfconvert.obj/output.o ../../build/ctfconvert.obj/st_bugs.o ../../build/ctfconvert.obj/st_parse.o ../../build/ctfconvert.obj/stabs.o ../../build/ctfconvert.obj/stack.o ../../build/ctfconvert.obj/strtab.o ../../build/ctfconvert.obj/symbol.o ../../build/ctfconvert.obj/tdata.o ../../build/ctfconvert.obj/traverse.o ../../build/ctfconvert.obj/util.o ../../build/libctf.a -ldwarf -lbfd -lelf -lz
cd cmd/instr ; make --no-print-directory
cd u
@ralphtheninja
ralphtheninja / hello-world.js
Last active December 10, 2015 03:18
mux-demux test
var MuxDemux = require('mux-demux');
var duplex = require('duplex');
var net = require('net');
var server = net.createServer(function (con) {
var mdm2 = MuxDemux(function (stream) {
if (stream.writable && stream.meta === 'times') {
var d = duplex().on('_data', function(data) {
if (data === 'hello') {
this._data('world');
@ralphtheninja
ralphtheninja / hoisting1.js
Last active December 10, 2015 03:58
hoisting examples
var a = 'old value';
function dude() {
a = 'new value';
console.log('in dude:', a);
return;
function a() {};
}