Skip to content

Instantly share code, notes, and snippets.

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 / 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",
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
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
@jaehess
jaehess / core.js
Created October 26, 2010 08:31 — forked from geoffreyd/core.js
App = SC.Application.create(
/** @scope Chase.prototype */ {
NAMESPACE: 'App',
VERSION: '0.1.0',
// This is your application store. You will use this store to access all
// of your model data. You can also set a data source on this store to
// connect to a backend server. The default setup below connects the store
// to any fixtures you define.
# mongo_template.rb
# remove unneeded defaults
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/javascripts/controls.js"
run "rm public/javascripts/dragdrop.js"
run "rm public/javascripts/effects.js"
run "rm public/javascripts/prototype.js"
/*
* CPNavigationBar.j
* AppKit
*
* Created by Nicholas Small.
* Copyright 2009, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
#
# Inspired by
# http://dev.rubyonrails.org/svn/rails/plugins/account_location/lib/account_location.rb
#
module SubdomainAccounts
def self.included( controller )
controller.helper_method(:account_domain, :account_subdomain, :account_url, :current_account, :default_account_subdomain, :default_account_url)
end
protected