Skip to content

Instantly share code, notes, and snippets.

@jaehess
jaehess / app.js
Created March 6, 2012 03:19 — forked from jfhbrook/app.js
THE FRAMEWORK YOUR FRAMEWORK COULD CODE LIKE
var flatiron = require('flatiron'),
app = flatiron.app;
console.log('What\'s that in your hand? Look down,');
app.use(require('./tickets'));
console.log('look up. I HAVE IT. It\'s ' + app.qty + ' TICKETS to ' + app.description + '!');
console.log('Look again.');
app.use(require('./diamonds'));
@jaehess
jaehess / gist:1791066
Created February 10, 2012 17:21 — forked from ktusznio/gist:1790846
batman.js checkbox example
<!DOCTYPE html>
<html>
<head>
<title>Test App</title>
<script type="text/javascript" src="../lib/es5-shim.js"></script>
<script type="text/javascript" src="../lib/batman.js"></script>
<script type="text/javascript" src="../lib/batman.solo.js"></script>
<script type="text/javascript" src="../lib/extras/batman.rails.js"></script>
<script type="text/javascript" src="../lib/coffee-script.js"></script>
</head>
@jaehess
jaehess / example.coffee
Created February 9, 2012 22:40
Example Association
class Author extends Batman.Model
@hasMany 'topics'
@hasMany 'posts'
class Topics extends Batman.Model
@belongsTo 'author'
@hasMany 'posts'
class Post extends Batman.Model
@belongsTo 'author'
class Batman.SetTransform extends Batman.Set
constructor: (@source, observedItemKeys..., @transform) ->
super()
@transformIndex = new Batman.SimpleHash
if @source.isObservable
@_setObserver = new Batman.SetObserver(@source)
@_setObserver.observedItemKeys = observedItemKeys
@_setObserver.observerForItemAndKey = @observerForItemAndKey
@_setObserver.on 'itemsWereAdded', @add
@_setObserver.on 'itemsWereRemoved', @remove
/*
example design of an expandable list view that expands selected items in place using alternate list item view
*/
tasksView: SC.ScrollView.design({
hasHorizontalScroller: NO,
layout: { top: 24, bottom: 0, left: 0, right: 0 },
backgroundColor: 'white',
contentView: Tasks.ExpandableListView.design({
contentBinding: 'Tasks.controller.arrangedObjects',
selectionBinding: 'Tasks.controller.selection',
@jaehess
jaehess / test.rb
Created September 17, 2011 20:26 — forked from tenderlove/test.rb
require 'thread'
require 'json'
require 'net/http'
require 'uri'
require 'betabrite'
require 'psych'
require 'usb'
class StreamClient
def initialize user, pass
@jaehess
jaehess / gvimrc.local
Created June 4, 2011 05:59
gvimrc.local
set transparency=5
set guioptions=aAce
syntax enable
colorscheme solarized
if has('gui_running')
set background=light
else
@jaehess
jaehess / mapreduce.js
Created May 9, 2011 02:34 — forked from adomado/mapreduce.js
Simple MapReduce with Javascript
var Job = {
data : [
"We are glad to see you here. This site is dedicated to",
"poetry and to the people who make poetry possible",
"poets and their readers. FamousPoetsAndPoems.com is",
"a free poetry site. On our site you can find a large",
"collection of poems and quotes from over 631 poets",
"Read and Enjoy Poetry",
"I, too, sing America",
// http://localhost:5984/addressbook/_design/person/_list/csv/all
// http://localhost:5984/addressbook/_design/person/_list/csv/by_name?reduce=false
function(head, req) {
// log(req)
var viewname = req.path.pop()
var filename = req.info.db_name+'-'+viewname+'.csv'
class MyClass
def initialize
@something = true
end
def main
# RUN code
end