Skip to content

Instantly share code, notes, and snippets.

View edwardhotchkiss's full-sized avatar

Edward Hotchkiss edwardhotchkiss

View GitHub Profile
###
@object App
Main Application File
###
# Bind jQuery
$ = jQuery
# App just initializes this class
<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<script src="/js/app.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
var app = require('App').init();
app.speak('!');
# deps
fs = require('fs')
express = require('express')
stitch = require('stitch')
# express server
app = express.createServer()
# configure express, /public for index.html
@edwardhotchkiss
edwardhotchkiss / coffee-or-error.coffee
Created May 29, 2012 18:33
coffee-script or error
@id = params.id or (->
throw new Error 'id must be defined!'
)()
@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) {
@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 / 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 / create.sh
Created May 25, 2012 03:14
blog: Node.JS - Automation with a Makefile
$ cd my_project
$ touch Makefile
@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 / 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'
});