Skip to content

Instantly share code, notes, and snippets.

View sandersch's full-sized avatar

Charlie Sanders sandersch

View GitHub Profile
@sandersch
sandersch / gist:1803638
Created February 11, 2012 19:06
Mixin trouble with Spine.js
class AjaxHelpers
unbind_ajax_handlers: (item) ->
item.unbind('ajaxSuccess')
item.unbind('ajaxError')
ajax_error_handler: (item, xhr) ->
if xhr.responseText
alert("#{key.split('_').join(' ')} #{value}") for key, value of jQuery.parseJSON(xhr.responseText)
else
alert("There was a problem submitting this update to the server.")
@sandersch
sandersch / gist:2961398
Created June 20, 2012 18:22
Exception: SQL logic error or missing database
*** Error receiving message: {:sender=>"<test@test.com>", :recipients=>["<victor.prechtel@asolutions.com>"], :source=>"Date: Wed, 20 Jun 2012 18:16:17 +0000\nFrom: Glu Staff <test@test.com>\nTo: victor.prechtel@asolutions.com\nMessage-ID: <4fe213714ffe7_447c1450b681657a@t1dmobile.asolutions.com.mail>\nSubject: Reset password instructions\nMime-Version: 1.0\nContent-Type: multipart/related;\n boundary=\"--==_mimepart_4fe213714b129_447c1450b681614c\";\n charset=UTF-8\nContent-Transfer-Encoding: 7bit\n\n\n\n----==_mimepart_4fe213714b129_447c1450b681614c\nDate: Wed, 20 Jun 2012 18:16:17 +0000\nMime-Version: 1.0\nContent-Type: multipart/alternative;\n boundary=\"--==_mimepart_4fe213714a90e_447c1450b681606b\";\n charset=UTF-8\nContent-Transfer-Encoding: 7bit\nContent-ID: <4fe213714eed8_447c1450b68164a4@t1dmobile.asolutions.com.mail>\n\n\n\n----==_mimepart_4fe213714a90e_447c1450b681606b\nDate: Wed, 20 Jun 2012 18:16:17 +0000\nMime-Version: 1.0\nContent-Type: text/plain;\n charset=UTF-8\nContent-Transfer-Encoding: qu
@sandersch
sandersch / extract-files_error.2012-07-28
Created July 29, 2012 00:06
Error running extract-files.sh
charlie@smith:/mnt/build/cm/device/samsung/epic4gtouch$ ./extract-files.sh
Extracting /system/bin/rild ...
113 KB/s (9792 bytes in 0.084s)
Extracting /system/lib/libril.so ...
496 KB/s (57272 bytes in 0.112s)
Extracting /system/lib/libsec-ril40.so ...
2025 KB/s (349696 bytes in 0.168s)
Extracting /system/lib/libsecril-client.so ...
166 KB/s (13708 bytes in 0.080s)
Extracting /system/lib/hw/alsa.default.so ...
# encoding: utf-8
def  
puts "america, fuck yeah"
end
10.times {   }
@sandersch
sandersch / Guardfile
Created December 17, 2012 01:51 — forked from anonymous/Guardfile
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard 'rspec', :version => 2 do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
end
@sandersch
sandersch / gist:5069618
Last active December 14, 2015 10:09
Mathieu Martin advice to Charles Hoffman on Ruby Rogues Parley mailing list

Hey Charles,

For some reason, your situation really resonates with me. I've read this whole thread from start to finish 3 times, so far. I mostly want to give my own answers and guidance to as many points as I can. Please ask follow-up questions if anything's unclear.

First I want to say John Woffindin's answer seems very interesting for your case. Definitely a +1.

And before I get into all of my points, sorry for the Markdown, but I really have to go to sleep now. No way I'm taking the time to format all that in Gmail :-)

Ruby 1.9.3-p392
===========================================================
All memory used before 1st run - 7 MB
Memory consumed by 1st run of eat_up_memory - 445 MB
All memory used before 2nd run - 452 MB
Memory consumed by 2nd run of eat_up_memory - 20 MB
All memory used before 3rd run - 472 MB
Memory consumed by 3rd run of eat_up_memory - 5 MB
Memory used before explicit GC.start - 478 MB
Memory used after explicit GC.start - 284 MB
@sandersch
sandersch / ruby_memory_retainment.txt
Last active December 14, 2015 10:49
Test Ruby's ability to release memory back to system. Results on Ubuntu 12.04 amd64 using rvm binary rubies.
Ruby 1.9.3-p392
==================
All memory used before 1st run - 7 MB
Memory consumed by 1st run of eat_up_memory - 440 MB
All memory used before 2nd run - 447 MB
Memory consumed by 2nd run of eat_up_memory - 5 MB
All memory used before 3rd run - 453 MB
Memory consumed by 3rd run of eat_up_memory - 9 MB
Memory used before explicit GC.start - 463 MB
Memory used after explicit GC.start - 463 MB
@sandersch
sandersch / empty_node.rb
Last active December 17, 2015 22:29
Little spike on Tree implementation with EmptyNode as a NullObject
class Tree
class << ( EmptyNode = Object.new )
def upsert(parent, side, new_child)
parent.send("#{side}=", new_child)
parent
end
def contains?(*)
false
end
@sandersch
sandersch / lich_version_info.txt
Last active December 18, 2015 18:50
Download all the liches
lich-3.59.rb 04-Feb-2011 03:42 167248
lich-3.60.rb 04-Feb-2011 03:42 165961
lich-3.61.rb 04-Feb-2011 03:42 165931
lich-3.62.rb 04-Feb-2011 03:43 167649
lich-3.63.rb 04-Feb-2011 03:42 167667
lich-3.64.rb 04-Feb-2011 03:42 167854
lich-3.65.rb 04-Feb-2011 03:42 167873
lich-3.66.rb 04-Feb-2011 03:42 167965
lich-3.67.rb 04-Feb-2011 03:42 168300
lich-3.68.rb 04-Feb-2011 03:42 168190