Skip to content

Instantly share code, notes, and snippets.

View tauren's full-sized avatar

Tauren Mills tauren

View GitHub Profile
size = (obj) ->
s = 0
for own key of obj
s++
s
@tauren
tauren / output.txt
Created August 14, 2011 20:53
Fails jshint
creampie:common-client tauren$ cake smoosh
*********************************************************************
###### ## ## ####### ####### ###### ## ##
## ## ### ### ## ## ## ## ## ## ## ##
## #### #### ## ## ## ## ## ## ##
###### ## ### ## ## ## ## ## ###### #########
## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ##
###### ## ## ####### ####### ###### ## ##
@tauren
tauren / Base.coffee
Created July 12, 2011 21:15
Can't run compiled coffeescript through jshint
SZ.models.Base = Backbone.Model.extend {}
@tauren
tauren / gist:1071122
Created July 8, 2011 04:11
Git branch question

Ubuntu dev system (godzilla)

On my main development system, I've done a bunch of commits to master. No changes have been made to other branches. I successfully push my commits to my remote git repository.

tauren@godzilla:/projects/git/myproject$ git branch -a
* master
  remotes/origin/accounting
  remotes/origin/master
  remotes/origin/organizations

remotes/origin/registration

@tauren
tauren / gist:1045906
Created June 24, 2011 23:56
Make it safe to use console.log always. How to convert to coffeescript?
// usage: log('inside coolFunc', this, arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
log.history = log.history || []; // store logs to an array for reference
log.history.push(arguments);
if(this.console) {
arguments.callee = arguments.callee.caller;
console.log( Array.prototype.slice.call(arguments) );
}
};
# Static site
app.get '/site/*:name', (req,res) ->
console.log 'Getting file ' + req.params.name
res.sendfile __dirname + '/public/' + req.params.name
app.get '/realms', (req,res) ->
name = req.query.jsonp || 'jsonp'
res.contentType 'application/x-javascript'
fs.readFile __dirname + '/../../data/realms.json', (err,data) ->
if err
throw error
res.send name + '(' + data + ');'
tauren@godzilla:/projects/git/node$ ./configure --prefix=$HOME/local/node
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for program gcc or cc : /usr/bin/gcc
Checking for gcc : ok
Checking for library dl : yes
Checking for openssl : yes
screemake clean
python tools/waf-light clean
DEST_OS: linux
DEST_CPU: x64
Parallel Jobs: 8
tauren@godzilla:~$ ssh -vv [email protected]
OpenSSH_5.1p1 Debian-6ubuntu2, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /home/tauren/.ssh/config
debug1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to schedules.somewhere.com [192.168.192.126] port 22.
debug1: Connection established.