Skip to content

Instantly share code, notes, and snippets.

View thejonanshow's full-sized avatar

Jonan Scheffler thejonanshow

View GitHub Profile
@thejonanshow
thejonanshow / dynamical.rb
Created October 20, 2014 04:07
Why does :explodes raise LocalJumpError: no block given (yield)?
class Dynamical
define_method :works_fine do |&block|
5.times { |n| block.call(n) }
end
def also_works_fine(&block)
5.times { |n| block.call(n) }
end
define_method :explodes do |&block|
@thejonanshow
thejonanshow / gem_watcher_list_2
Created May 27, 2014 06:41
Another test list for gem watcher.
rspec
vcr
@thejonanshow
thejonanshow / gem_watcher_test_list
Last active August 29, 2015 14:01
A test list for the gem watcher application.
rake
rack
http://upload.wikimedia.org/wikipedia/commons/9/9b/A._percula.jpg
http://upload.wikimedia.org/wikipedia/commons/e/eb/Mantis_shrimp_from_front.jpg
@thejonanshow
thejonanshow / gist:a960511ee0d64f971527
Created May 20, 2014 04:07
Browser icons for Google Chrome, Mozilla Firefox and Internet Explorer
http://commons.wikimedia.org/wiki/File:Mozilla_Firefox_logo_2013.png
http://commons.wikimedia.org/wiki/File:Internet_Explorer_7_and_8_logo.png
http://commons.wikimedia.org/wiki/File:Google_Chrome_icon_(2011).png
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript" >
$(window).load(function() {
$("#navFill").height($("#contentWrapper").height()-558);
});
var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";
$(document).keydown(function(e) {
kkeys.push( e.keyCode );
@thejonanshow
thejonanshow / find_from_gemfile.rb
Created April 14, 2014 23:41
Searches the source of every gem in a Gemfile for a particular search term (using 'ag', The Silver Searcher)
term = ARGV[0]
puts "Searching all gems in Gemfile for #{term}..."
gemfile = File.read('Gemfile')
gems = gemfile.split("\n").map do |line|
next unless line.match(/gem '/)
line.split('gem').last.split(',').first.gsub("'","").split.first.strip
end.compact

Keybase proof

I hereby claim:

  • I am 1337807 on github.
  • I am jonan (https://keybase.io/jonan) on keybase.
  • I have a public key whose fingerprint is 16A9 8E59 705B EFF2 3A92 2779 1E10 A32A 2520 5CD8

To claim this, I am signing this object:

#
# This file configures the New Relic Agent. New Relic monitors
# Ruby, Java, .NET, PHP, and Python applications with deep visibility and low overhead.
# For more information, visit www.newrelic.com.
#
# Generated June 03, 2013
#
# This configuration file is custom generated for Barsoom
bundler•ruby-1.9.3-p392@bundler•master»» rake spec:deps --trace
rake aborted!
cannot load such file -- rspec/core/rake_task
/Users/jonan/Dropbox/code/bundler/Rakefile:54:in `require'
/Users/jonan/Dropbox/code/bundler/Rakefile:54:in `<top (required)>'
/Users/jonan/.rvm/gems/ruby-1.9.3-p392@bundler/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load'
/Users/jonan/.rvm/gems/ruby-1.9.3-p392@bundler/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/Users/jonan/.rvm/gems/ruby-1.9.3-p392@bundler/gems/rake-0.9.2.2/lib/rake/application.rb:501:in `raw_load_rakefile'
/Users/jonan/.rvm/gems/ruby-1.9.3-p392@bundler/gems/rake-0.9.2.2/lib/rake/application.rb:82:in `block in load_rakefile'
/Users/jonan/.rvm/gems/ruby-1.9.3-p392@bundler/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'