Opinions are like assholes, every one has got one.
This one is mine.
Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.
#!/bin/sh | |
FW='/sbin/iptables' | |
IP='123.123.123.123' # public ip | |
LO=80 # privileged port | |
HI=8000 # non-privileged port | |
PM=0x2a # packet mark - 32bit integer | |
# allow input on both ports |
sudo apt-get install libcairo2-dev libjpeg8-dev libgif-dev |
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Update 7 Oct 2010: | |
# - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
# the WebSocket protocol implementation in the cramp gem does not work | |
# well with Chrome's (newer) WebSocket implementation. | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
#!/bin/sh | |
[ $# -eq 0 ] && { echo "Usage: ${0} version-string" ; exit 1; } | |
VERSION=$1 | |
BUILD_DIR=/usr/local/src/node | |
ARC="node-v${VERSION}.tar.gz" | |
mkdir -p $BUILD_DIR | |
cd $BUILD_DIR |
#!/bin/sh | |
# warning: only tested on single line script tags, no doubt broken on multi-line | |
# useful for includes! | |
[ $# -eq 0 ] && { echo "Usage: ${0} file-name" ; exit 1; } | |
$FILE=$1 | |
sed -in '/script/{h;d};/\/body/{H;g}' $FILE |
; | |
(function(exports, undefined) { | |
angular.module('module.Socket', [], function($provide) { | |
$provide.factory('Socket', ['$rootScope', function socketController($rootScope) { | |
var scope = $rootScope.$new() | |
scope.socket = io.connect('/') | |
scope.send = function(message) { | |
try { | |
var m = JSON.stringify(message) |
var express = require('express'), | |
passport = require('passport'), | |
LocalStrategy = require('passport-local').Strategy, | |
connect = require('connect'), | |
http = require('http'), | |
path = require('path'), | |
util = require('util'), | |
fs = require('fs'), | |
redis = require('redis'), | |
cookie = require('cookie'), |
// Short module explanation // Something to gather my thoughts | |
// // I think this looks cool. | |
// | |
module.exports = the_exported_function // Modules are a function. Always. | |
// | |
module.exports.extra = extra // Additional API entry points if | |
module.exports.other = other // desired. | |
// | |
var util = require('util') // Other packages from npm or core | |
var assert = require('assert') // No comma-first due to lots of |
validate = (customer, next)-> | |
console.log 'validating...' | |
#VALIDATE HERE | |
next() | |
insert = (customer, next)-> | |
console.log 'inserting...' | |
# insert into DB (asynchronously of course), and then call... | |
next() |