Skip to content

Instantly share code, notes, and snippets.

View wavded's full-sized avatar
🐢
Turtles all the way

Marc Harter wavded

🐢
Turtles all the way
View GitHub Profile
@wavded
wavded / gist:1515551
Created December 23, 2011 22:29
Installing MongoDB on Ubuntu Server and Desktop

Edit /etc/apt/sources.list and add the following lines to the bottom of the file:

# MongoDB
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen

Then run the following commands:

@wavded
wavded / .zshrc
Created December 23, 2011 20:36
ZSHRC
# Path to your oh-my-zsh configuration.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
export ZSH_THEME="lukerandall"
# Set to this to use case-sensitive completion
@wavded
wavded / contact.coffee
Created November 9, 2011 16:37
Pushing a contact (tested against mongoose 2.3.11)
#!/usr/bin/env coffee
global.mongoose = require 'mongoose'
mongoose.connect 'mongodb://localhost/test'
Schema = mongoose.Schema
User = new Schema
userId : { type: String, index: true, required: true }
contacts : [ { type: Schema.ObjectId, ref: 'User' } ]
@wavded
wavded / populate.coffee
Created November 8, 2011 17:22
Populate a users contacts - works in 2.3.9 but not in 2.3.10
#!/usr/bin/env coffee
global.mongoose = require 'mongoose'
mongoose.connect 'mongodb://localhost/test'
Schema = mongoose.Schema
User = new Schema
userId : { type: String, index: true, required: true }
contacts : [ { type: Schema.ObjectId, ref: 'User' } ]
@wavded
wavded / fipsToState.json
Created September 29, 2011 15:27
State FIPS JSON
{
"01": "Alabama",
"02": "Alaska",
"04": "Arizona",
"05": "Arkansas",
"06": "California",
"08": "Colorado",
"09": "Connecticut",
"10": "Delaware",
"11": "District of Columbia",
@wavded
wavded / sample.json
Created September 7, 2011 14:51
Sample GeoJSON File
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wavded
wavded / gist:1067909
Created July 6, 2011 18:08
npm error
info it worked if it ends with ok
verbose cli [ 'node', '/usr/local/bin/npm', 'install' ]
info using [email protected]
info using [email protected]
verbose config file /home/jdevries/.npmrc
verbose config file /usr/local/etc/npmrc
silly testEngine { author: { name: 'Marc Harter', email: '[email protected]' },
silly testEngine name: 'rowe-law',
silly testEngine version: '0.0.1',
silly testEngine repository: { url: '' },
@wavded
wavded / gist:961713
Created May 8, 2011 21:42
functions
function render(view,locals){
return function(req,res){
res.render(view,locals || {});
};
}
var render = #(view,locals){
return #(req,res){
res.render(view,locals || {});
}
@wavded
wavded / Arc.js
Created March 15, 2011 17:00
Arc.js
/**
* Arc model
*
* @module Arc
* @requires mongoose (npm install mongoose)
* @requires User (models/User.js)
* @global mongoose
*/
var Schema = mongoose.Schema,
User = require('./User.js');
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',