Skip to content

Instantly share code, notes, and snippets.

View bradphelan's full-sized avatar

Brad Phelan bradphelan

View GitHub Profile
class Object
def should_receive!(sym, opts={}, &block)
objx = Object.new
@__rspec_obj__ ||= Object.new
m = class<<self;self;end
sym_old = "__#{sym}__old__"
class Foo < Sinatra::Base
configure do
EM.add_periodic_timer do
puts "hello"
end
end
<other stuff>
name: project
type: table
headers:
- string
- Poco/Types.h
- Ptv/Epg/Types.h
- Ptv/Core/Time.h
- TimeTypeHandler.h
field:
brad@bradgonesurfing:~/workspace/server$ping dachstein.local
PING dachstein.local (192.168.1.102) 56(84) bytes of data.
64 bytes from dachstein.local (192.168.1.102): icmp_seq=1 ttl=64 time=0.367 ms
64 bytes from dachstein.local (192.168.1.102): icmp_seq=2 ttl=64 time=0.379 ms
^C
--- dachstein.local ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.367/0.373/0.379/0.006 ms
brad@bradgonesurfing:~/workspace/server$nslookup dachstein.local
Server: 217.16.112.21
nameserver 192.168.122.1
nameserver 217.16.112.21
nameserver 217.16.112.22
typedef vector<auto_ptr<foo> > foo_vector;
foo_vector fv;
fv.push_back(auto_ptr<foo>(new foo()));
auto_ptr<foo> p = fv[0]; // oops
brad@bradgonesurfing:~/job-application$gem list | grep rspec
rspec (2.0.0)
rspec-core (2.0.0)
rspec-expectations (2.0.0)
rspec-mocks (2.0.0)
class WordView extends Backbone.View
tagName: "li"
render: ->
$(this.el).html "#{@model.get('article')} #{@model.get('word')} (#{@model.get('score')})"
$(this.el).addClass(@model.get('article'))
return this
class WordListView extends Backbone.View
@bradphelan
bradphelan / gist:1014261
Created June 8, 2011 11:38
rails 3.1 compass error log
=> Rails 3.1.0.rc2 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-06-08 13:37:06] INFO WEBrick 1.3.1
[2011-06-08 13:37:06] INFO ruby 1.9.2 (2011-02-18) [x86_64-darwin10.7.3]
[2011-06-08 13:37:06] INFO WEBrick::HTTPServer#start: pid=5748 port=3000
Started GET "/m/logger" for 127.0.0.1 at 2011-06-08 13:37:06 +0200
Processing by M::LoggerController#show as HTML
@bradphelan
bradphelan / pageview.js.coffee
Created June 15, 2011 13:46
backbone based mobile page model
#=require haml
#=require backbone
class PageView extends Backbone.View
tag: "div"
class: "page"
classes: ->
[]