Skip to content

Instantly share code, notes, and snippets.

View alexindigo's full-sized avatar
💭
I may be slow to respond.

Alex Indigo alexindigo

💭
I may be slow to respond.
  • Palo Alto, CA
View GitHub Profile
@alexindigo
alexindigo / redis-server-for-init.d-startup
Created February 21, 2011 10:58 — forked from peterc/redis-server-for-init.d-startup
Redis init.d file for Ubuntu/Debian
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@alexindigo
alexindigo / LICENSE.txt
Created May 21, 2011 05:20 — forked from madrobby/LICENSE.txt
Mock objects
Copyright (c) 2011 Thomas Fuchs, http://mir.aculo.us/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@alexindigo
alexindigo / node_debian_init.sh
Created July 17, 2011 21:42 — forked from peterhost/node_debian_init.sh
Daemon init script for node.js based app/server (DEBIAN/UBUNTU)
#! /bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
@alexindigo
alexindigo / redis.conf
Created October 23, 2011 02:08 — forked from carlzulauf/redis.conf
Redis upstart script (/etc/init/)
description "redis server"
start on runlevel [2345]
stop on shutdown
expect fork
exec sudo -u redis /usr/local/bin/redis-server /usr/local/etc/redis.conf
respawn
@alexindigo
alexindigo / README.md
Created May 20, 2012 02:15 — forked from SaltwaterC/README.md
Async frameworks "Hello World" showdown
@alexindigo
alexindigo / README.md
Created September 1, 2012 21:06 — forked from adammw/README.md
Node.js for Raspberry Pi

Node.js for Raspberry Pi

This is a work in progress - it may not work!

Pre-built binaries

Raspbian (hard-float)

v0.8.6-pre (adammw/node@3a42578d477249cc8851cd76cfb4fa4cb88ab0a0)

@alexindigo
alexindigo / jsonparse.js
Last active December 22, 2015 04:28 — forked from creationix/jsonparse.js
Added comments parsing
// Named constants with unique integer values
var C = {};
// Tokenizer States
var START = C.START = 0x11;
var TRUE1 = C.TRUE1 = 0x21;
var TRUE2 = C.TRUE2 = 0x22;
var TRUE3 = C.TRUE3 = 0x23;
var FALSE1 = C.FALSE1 = 0x31;
var FALSE2 = C.FALSE2 = 0x32;
var FALSE3 = C.FALSE3 = 0x33;
var $ = require('NodObjC');
$.import('Cocoa');
var installNSBundleHook = function() {
var cls = $.NSBundle;
if (cls) {
var bundleIdentifier = cls.getInstanceMethod('bundleIdentifier');
bundleIdentifier.setImplementation(function(val) {
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@alexindigo
alexindigo / echoHttpRequest.js
Last active August 27, 2015 16:51 — forked from Marak/echoHttpRequest.js
Echo HTTP requests
module['exports'] = function echoHttp (hook) {
console.log("Console messages are sent to /logs");
console.log(hook.params);
console.log(hook.req.path);
console.log(hook.req.method);