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
var bigBlob = Array.apply(null, Array(1024 * 100)).map(function () { return 'aaaaaaaaaa' }).join('')
// Load the TCP Library
net = require('net');
// Keep track of the chat clients
var clients = [];
// Start a TCP Server
net.createServer(function (socket) {
// Identify this client
var stream = createStream()
net.createServer(function (con) {
con.on('data', function (data) {
console.log('S <- ' + data.toString())
})
stream.on('data', function (data) {
console.log('S -> ' + data.toString())
})
stream.pipe(con).pipe(stream)
})
installall('levelup', __dirname, function (err, paths) {
if (err) throw err;
console.log(paths);
});
/*
{
"0.7.0": "/levelup/0.7.0",
"0.6.0": "/levelup/0.6.0"
}

Writing node modules with voxel.js

This is a short guide that will teach you the workflows that have been figured out by the voxel.js community for writing node modules + sharing them on NPM and Github. It is assumed that you have a basic understanding of JavaScript, github and the command line (if not you can check out an introduction to git and the command line or learn JS basics from JavaScript for Cats)

Table of contents