Skip to content

Instantly share code, notes, and snippets.

// Document Model
dc.model.Document = Backbone.Model.extend({
constructor : function(attrs, options) {
attrs.selected = false;
attrs.selectable = true;
if (attrs.annotation_count == null) attrs.annotation_count = 0;
Backbone.Model.call(this, attrs, options);
var id = this.id;
// Main controller for the journalist workspace. Orchestrates subviews.
dc.controllers.Workspace = Backbone.Controller.extend({
routes : {
'help/:page': 'help',
'help': 'help'
},
// Initializes the workspace, binding it to <body>.
initialize : function() {
@czottmann
czottmann / Procfile
Created June 15, 2011 13:43
Example of a Foreman/Capistrano/upstart setup
worker: QUEUE=* bundle exec rake environment resque:work
scheduler: bundle exec rake environment resque:scheduler
$ rvm install jruby
$ rvm --create jruby@torquebox
$ gem install bundler
$ gem install torquebox-server --pre --source http://torquebox.org/2x/builds/LATEST/gem-repo/
$ gem install rails
$ rails new myapp -m $(torquebox env TORQUEBOX_HOME)/share/rails/template.rb
$ cd myapp
$ torquebox deploy
$ torquebox run
@headius
headius / gist:1234935
Created September 22, 2011 14:38
OS X 'pickjdk' command with single-command selection and updated JDK location
#!/bin/bash
#
# Provides a function that allows you to choose a JDK. Just set the environment
# variable JDKS_ROOT to the directory containing multiple versions of the JDK
# and the function will prompt you to select one. JAVA_HOME and PATH will be cleaned
# up and set appropriately.
_macosx()
{
if [ $(uname -s) = Darwin ]; then
@johnpaulashenfelter
johnpaulashenfelter / upgrade_homebrew_pg.sh
Created November 11, 2011 15:31
Upgrading homebrew postgres from 9.0.x to 9.1
Upgrading to homebrew postgresql 9.1.1 from 9.0.x
* Copy the old data
mv -R /usr/local/var/postgres/ /usr/local/var/postgres-901
* Create a new database using 9.1.1
/usr/local/Cellar/postgresql/9.1.1/bin/initdb /usr/local/var/postgres
@aderyabin
aderyabin / gist:1465125
Created December 12, 2011 05:22
AppleScript to migrate from Things to Omnifocus
--------------------------------------------------
--------------------------------------------------
-- Import tasks from Things to OmniFocus
--------------------------------------------------
--------------------------------------------------
tell application "Things"
-- Loop through ToDos in Things
repeat with aToDo in to dos of list "Next"
@jamesarosen
jamesarosen / ember-views-and-states.md
Created January 11, 2012 00:21
On Ember Views & States

I have a state machine for the major sections of the page:

App.States = Ember.StateManger.create({
  foo: Ember.State.create({})
});

I have a view that needs to reset itself whenever the user enters the foo state:

@enthal
enthal / index.html
Created January 28, 2012 20:36
Example of d3 axis() for axes and grid lines
<!DOCTYPE html>
<html>
<head>
<title>D3 - Line Chart - axes and grid using axis()</title>
<!-- script type="text/javascript" src="https://raw.github.com/jquery/sizzle/master/sizzle.js"></script -->
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.min.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.time.min.js"></script>
<style type="text/css">
body {
@christophermanning
christophermanning / README.mkd
Last active August 28, 2023 00:46
Hamiltonian Graph Builder
<style type="text/css">p {text-align:center;width: auto}</style>

Created by Christopher Manning

Gallery

Axle Eight Fibbobaci Florets [![Star]