Skip to content

Instantly share code, notes, and snippets.

View DTrejo's full-sized avatar

David Trejo DTrejo

View GitHub Profile
@DTrejo
DTrejo / script.sh
Created March 16, 2012 02:49
how to get dropbox and flux working on your sunlab account
#
# add this to your ~/.bashrc
#
# start dropbox
if [ "$(pidof dropbox)" ]
then
# dont start
echo "dropbox is running"
else
/*
# set a password, leave all else as default
echo "requirepass password" >> tests/auth_error.conf
# start redis server
redis-server tests/auth_error.conf
# run this script
node tests/auth_error.js
*/
@DTrejo
DTrejo / animals.js
Created February 14, 2012 23:47
dog and cat and animal
function Animal() {
this.legs = 4;
};
function Dog() {
this.sound = 'woof';
};
Dog.prototype = new Animal();
function Cat() {
@DTrejo
DTrejo / notfound.js
Created February 9, 2012 21:57
notfound not called
var http = require('http')
, director = require('director')
, PORT = process.env.port || 8000
var routes = {
'/hello': {
get: function(route) { this.res.end('/hello') }
}
}
var routerOptions = { notfound: notFound }
@DTrejo
DTrejo / server.js
Created January 5, 2012 08:41 — forked from anonymous/server.js
fixed :)
var http = require('http');
var fs = require('fs');
var ip = '127.0.0.1';
var port = 2000;
var www = process.cwd();
var mimetypes = {'html': 'text/html', 'js': 'text/javascript', 'css': 'text/css', 'png': 'image/png', 'svg': 'image/svg'};
var path = require('path');
http.createServer(function (req, res) {
fs.realpath(path.join(www, req.url), function(err, realpath){
@DTrejo
DTrejo / node-and-npm-in-30-seconds.sh
Created November 13, 2011 21:45 — 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
/Dropbox/dev/npmpants/slave/test(master)§ npm test nano | pbcopy
sh: ./node_modules/ensure/bin/tap.js: No such file or directory
npm ERR! nano@0.9.4 test: `./node_modules/ensure/bin/tap.js tests/*/*.js`
npm ERR! `sh "-c" "./node_modules/ensure/bin/tap.js tests/*/*.js"` failed with 127
npm ERR!
npm ERR! Failed at the nano@0.9.4 test script.
npm ERR! This is most likely a problem with the nano package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./node_modules/ensure/bin/tap.js tests/*/*.js
@DTrejo
DTrejo / 9gdb.log
Created November 5, 2011 08:10
logs & crash
~/Downloads/node-v0.6.0§ gdb --args out/Debug/node test/simple/test-assert.js
GNU gdb 6.3.50-20050815 (Apple version gdb-1515) (Sat Jan 15 08:33:48 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ........... done
@DTrejo
DTrejo / 8-gcc-v
Created November 5, 2011 07:41
0.6.0rc2 mac 10.6.8 testing
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5666.3~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
@DTrejo
DTrejo / 9confdebugmakemaketestall.log
Created November 5, 2011 07:14
0.6.0rc2 mac 10.6.8 testing
~/Downloads/node-v0.6.0§ ./configure --debug && make && make test-all >> config-debug-make-make-test-all.log
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