Skip to content

Instantly share code, notes, and snippets.

View edwardhotchkiss's full-sized avatar

Edward Hotchkiss edwardhotchkiss

View GitHub Profile
$.Preloader({
barColor : '#f57b50',
overlayColor : '#8e4d6b',
barHeight : '10px',
siteHolder : '#container'
});
@edwardhotchkiss
edwardhotchkiss / action.js
Created May 25, 2012 02:48
node.js list all mongodb databases
/**
* Uses MongooseJS to Connect to MongoDB
* .Maps out all collections within
*/
var mongoose = require('mongoose')
, MONGO_DB = 'mongodb://localhost/test';
mongoose.connect(MONGO_DB);
@edwardhotchkiss
edwardhotchkiss / normal.js
Created May 25, 2012 02:52
jekyll and mixpanel blog post
mpq.track('EventName', { some : 'data' });
@edwardhotchkiss
edwardhotchkiss / postage.js
Created May 25, 2012 02:53
postage app blog post
var postage = require('postage')('YOUR API KEY');
var options = {
recipients: 'email@address.com',
subject: 'Subject Line',
from: 'sender@example.org',
content: {
'text/html': '<p>Some awesome content</p>',
'text/plain': 'Plain text goes here (if any)'
@edwardhotchkiss
edwardhotchkiss / app.js
Created May 25, 2012 02:55
learning angular.js 1.0.0 blog post
var app = angular.module('app', [], function($routeProvider) {
$routeProvider.when('/welcome', {
template : 'partials/welcome.html',
controller : WelcomeController
});
$routeProvider.otherwise({
redirectTo : '/welcome'
});
@edwardhotchkiss
edwardhotchkiss / 1.js
Created May 25, 2012 03:09
5 Ways to export the same Node.js module
var dude = require('./dude');
dude.say('hey bro.');
@edwardhotchkiss
edwardhotchkiss / create.sh
Created May 25, 2012 03:14
blog: Node.JS - Automation with a Makefile
$ cd my_project
$ touch Makefile
@edwardhotchkiss
edwardhotchkiss / test_spawn.js
Created May 25, 2012 03:17
blog: testing a spawned process with node.js and vows
var child
, stdout = ''
, stderr = ''
, exitCode = 0
, vows = require('vows')
, path = require('path')
, assert = require('assert')
, request = require('request')
, spawn = require('child_process').spawn;
@edwardhotchkiss
edwardhotchkiss / angular_way.js
Created May 25, 2012 03:18
Angular.js Routing Like a Boss (blog)
$route.when('/some/route', {
template : 'partials/some/route.html',
controller : SomeRouteController
});
@edwardhotchkiss
edwardhotchkiss / angular_app.js
Created May 25, 2012 03:22
Jekyll Live Search with AngularJS (blog)
/**
* Setup Module with `highlight` filter
*/
var JekyllApp = angular.module('JekyllApp', [], function($routeProvider) {
});
JekyllApp.filter('highlight', function() {
return function(text, filter) {