Skip to content

Instantly share code, notes, and snippets.

View searls's full-sized avatar
💚

Justin Searls searls

💚
View GitHub Profile
class Camel < ActiveRecord::Base
def initialize(attributes = nil, options = {})
super(underscore_keys(attributes), options)
end
def attributes=(new_attributes, guard_protected_attributes=nil)
super(underscore_keys(new_attributes, guard_protected_attributes))
end
def serializable_hash(options = nil)
2011-10-25T19:21:51+00:00 heroku[web.1]: Starting process with command `bin/hubot -a campfire -n Doubot`
2011-10-25T19:21:51+00:00 app[web.1]: bin/hubot: 3: npm: not found
2011-10-25T19:21:51+00:00 app[web.1]: /usr/bin/env: coffee: No such file or directory
window.concatenation = function(s1,s2) {
return s1 + ', ' + s2 + " and pandas!";
};
@searls
searls / call-list-spec.js
Created October 29, 2011 19:34
Example JavaScript!
describe('CallList', function() {
var subject;
beforeEach(function() {
subject = new CallList({items: ['A','B','C']});
});
describe("#moveUp", function() {
context("moving up C", function() {
beforeEach(function() {
subject.moveUp('C');
describe('CallList', function() {
var subject;
beforeEach(function() {
subject = new CallList({items: ['A','B','C']});
});
describe("#moveUp", function() {
context("moving up C", function() {
beforeEach(function() {
subject.moveUp('C');
@searls
searls / scripts_plz.js
Created October 30, 2011 14:39
A little bookmarklet to get an array of all of the current hubot scripts
prompt('',JSON.stringify($('.content a').map(function(i,el){
if($(el).text().indexOf(".coffee") !== -1) {
return $(el).text();
}
}).toArray()));
describe "panda", ->
Given -> inject('foo')
Given -> inject('bar')
Then(-> expect($('.foo')).toExist())
.Then(-> expect($('.bar')).toExist())
describe('CallList', function() {
var subject;
beforeEach(function() {
subject = new CallList({items: ['A','B','C']});
});
describe("#moveUp", function() {
context("moving up C", function() {
beforeEach(function() {
subject.moveUp('C');
describe "CallListView", ->
beforeEach ->
@subject = new CallListView
describe "events", ->
it "binds to up-arrow clicks", ->
expect(@subject.events).toEqual "click .up-arrow": 'moveUp'
describe "CallListView", ->
beforeEach ->
@model = jasmine.createSpyObj('CallList',['bind','moveUp'])
@subject = new CallListView model: @model
describe "events", ->
it "binds to up-arrow clicks", ->
expect(@subject.events).toEqual "click .up-arrow": 'moveUp'
describe "#moveUp", ->