Skip to content

Instantly share code, notes, and snippets.

$ ->
return if $("#console").length < 1
$("#console_input").keyup (event) ->
if event.which == 13
command = $(this).val()
$.ajax
url: '/console'
type: 'POST'
dataType: 'text'
@pixelmatrix
pixelmatrix / caveatPatchor.js
Created February 25, 2011 05:17 — forked from protocool/caveatPatchor.js
Add Droplr support to caveatPatchor
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
@dnagir
dnagir / rspec-syntax-cheat-sheet.rb
Created November 5, 2010 09:29
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
class Date
def to_words
if self == Date.today
"Today"
elsif self <= Date.today - 1
if self == Date.today - 1
"Yesterday"
elsif ((Date.today - 7)..(Date.today - 1)).include?(self)
"Last #{self.strftime("%A")}"
elsif ((Date.today - 14)..(Date.today - 8)).include?(self)