Skip to content

Instantly share code, notes, and snippets.

🐢
Learning rust and PostgreSQL

Lars-Magnus Skog ralphtheninja

🐢
Learning rust and PostgreSQL
Block or report user

Report or block ralphtheninja

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ralphtheninja
ralphtheninja / backbone.htm
Created May 1, 2012 — forked from JasonMore/backbone.htm
Backbone.js TODO app implemented in knockout.js
View backbone.htm
<!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 — 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.
View node-and-npm-in-30-seconds.sh
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
View gist:2624835
<!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 Aug 11, 2012 — forked from turtlesoupy/nginx.conf
node.js upstream nginx config
View nginx.conf
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 Aug 14, 2012 — forked from aemkei/LICENSE.txt
Lorenz Attractor - 140byt.es
View LICENSE.txt
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 Oct 10, 2012
node.js and http CONNECT method
View gist:3868236
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 Oct 17, 2012
CouchDB error when replicating
View couchdb.log
[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 Dec 22, 2012
compile error for dtrace-for-linux on ubuntu
View gist:4357616
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
View hello-world.js
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 Dec 10, 2015
hoisting examples
View hoisting1.js
var a = 'old value';
function dude() {
a = 'new value';
console.log('in dude:', a);
return;
function a() {};
}
You can’t perform that action at this time.