Skip to content

Instantly share code, notes, and snippets.

View jherdman's full-sized avatar

James Herdman jherdman

View GitHub Profile
# Don't do this
class SomeFancyClass
def my_interesting_method
# ...
locate_all_the_rainbows(...)
# ...
end
# Hundreds of lines below...
def locate_all_the_rainbows(args)
var vows = require('vows')
, assert = require('assert')
, io = require('socket.io-client')
, socket = io.connect('http://localhost:4000');
socket.on('done', function () {
socket.disconnect();
});
var userMessages = {
-- Why do both of these definitions work...
max' :: (Ord a) => a -> a -> a
max' a b
| a >= b = a
| otherwise = b
max' :: (Ord a) => a -> (a -> a)
max' a b
| a >= b = a
replicate' :: (Num i, Ord i) => i -> a -> [a]
replicate' n x
| n <= 0 = []
| otherwise = x:replicate' (n - 1) x
D = Class.new
def to_s
"to ess!"
end
def to_str
"to stir!"
end
end
Rails 3.1.2
Finished in 1677.71 seconds
4185 examples, 0 failures, 3 pending
Rails 3.1.1
Finished in 157.91 seconds
4185 examples, 0 failures, 3 pending
Uncaught ReferenceError: Mailer is not defined
6Unsafe JavaScript attempt to access frame with URL http://www.okcupid.com/messages?readmsg=true&threadid=11263769704670532725&folder=1#send from frame with URL http://ads.okcimg.com/daisy?prev=AdMeld-RTB&format=leader&page=Mailbox. Domains, protocols and ports must match.
6Unsafe JavaScript attempt to access frame with URL http://www.okcupid.com/messages?readmsg=true&threadid=11263769704670532725&folder=1#send from frame with URL http://ads.okcimg.com/daisy?prev=AdMeld-RTB&format=sky&page=Mailbox. Domains, protocols and ports must match.
Unsafe JavaScript attempt to access frame with URL http://ads.okcimg.com/daisy?format=leader&base=1&page=Mailbox&authid=1%2c0%2c1321059550%2c0xff71beb99d1b6c8e%3b33a30fb0582569564ef9ecde126a859406459534&pageurl=%2fmessages&cachebust=51349 from frame with URL http://www.okcupid.com/messages?readmsg=true&threadid=11263769704670532725&folder=1#send. Domains, protocols and ports must match.
Unsafe JavaScript attempt to access frame
-----> Heroku receiving push
-----> Ruby/Rack app detected
-----> Gemfile detected, running Bundler version 1.0.7
Unresolved dependencies detected; Installing...
Using --without development:test
You have modified your Gemfile in development but did not check
the resulting snapshot (Gemfile.lock) into version control
You have deleted from the Gemfile:
* growl_notify
var fs = require('fs')
, libxmljs = require('libxmljs')
, doc = fs.createReadStream('sax_parser.xml', { encoding: 'utf8' });
var parser = new libxmljs.SaxPushParser(function (p) {
var characters = '';
p.onStartDocument(function () {
console.log('Start parsing');
console.time('XML Parsing');
@jherdman
jherdman / delegate_matcher.rb
Created September 6, 2011 13:58 — forked from txus/delegate_matcher.rb
RSpec matcher for delegations
# RSpec matcher to spec delegations.
#
# Usage:
#
# describe Post do
# it { should delegate(:name).to(:author).with_prefix } # post.author_name
# it { should delegate(:month).to(:created_at) }
# it { should delegate(:year).to(:created_at) }
# end