Skip to content

Instantly share code, notes, and snippets.

View donovanbray's full-sized avatar

Donovan Bray donovanbray

  • homerun.com
  • San Francisco
View GitHub Profile
@donovanbray
donovanbray / git pull strace snippit
Last active December 19, 2015 06:29
git pull issue
[pid 19719] open(".git/objects/4d/6d3413cc0e6c44859b1410a7f20939b47e22da", O_RDONLY|O_NOATIME) = 134
[pid 19719] fstat(134, {st_mode=S_IFREG|0444, st_size=186, ...}) = 0
[pid 19719] mmap(NULL, 186, PROT_READ, MAP_PRIVATE, 134, 0) = 0x7f75f2b49000
[pid 19719] close(134) = 0
[pid 19719] munmap(0x7f75f2b49000, 186) = 0
[pid 19719] write(131, "0032have 6d619037683a7014f871ec3"..., 1604 <unfinished ...>
[pid 19720] <... select resumed> ) = 1 (in [4])
[pid 19720] read(4, "0032have 6d619037683a7014f871ec3"..., 16384) = 1604
[pid 19720] select(7, [3 4], [3], NULL, NULL) = 1 (out [3])
[pid 19720] write(3, "$\210Bv\304\2146\177HM\0\10M\317B\1\300\373\3\366R\314W\322\245s\367\253\304kV\253"..., 1648) = 1648
@donovanbray
donovanbray / user_spec.rb
Created June 10, 2013 21:32
test sample
describe User, 'as super_admin' do
subject { Factory(:super_admin, :email => 'super@duper.com')}
before(:each) do
PartnerScope.with(Partner.serve) { Factory(:super_admin, :email => 'super@duper.com') }
end
describe "#super_admin_for" do
it "returns multiple partners" do
expect(subject.super_admin_for).to have_at_least(2).items
end
it "doesn't include partners without a lib/config/partners configuration" do
@donovanbray
donovanbray / Add subscriptions
Created January 6, 2012 00:54
The users in staging test database need to be subscribed to a national deal.
def testme
p = User.where("email like '%offerify.net'" )
p.each_with_index {|user,i|
puts 'so far - ' + i.to_s + Time.now.to_s if i % 500 == 0
@params = {:user_id=>user.id, :region=>Region.national.first, :partner=>$current_partner, :is_midday_subscribed=>false, :is_pr_subscribed=>false}
Subscription.create(@params)
}
end
#!/usr/bin/ruby
# Pingdom_http_custom_check
# DFF - 2011
# put this in {Apache Files}/cgi-bin/
# make sure to chmod +x the file
# Your ruby interpreter might not be where mine is. Check the above.
#
require 'cgi'
too_old=360