Skip to content

Instantly share code, notes, and snippets.

View dennmart's full-sized avatar

Dennis Martinez dennmart

View GitHub Profile
export RUBY_HEAP_MIN_SLOTS=1000000
export RUBY_HEAP_SLOTS_INCREMENT=1000000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=1000000000
export RUBY_HEAP_FREE_MIN=500000
@dennmart
dennmart / benchmark.rb
Created June 11, 2012 17:19 — forked from panthomakos/benchmark.rb
Benchmark Your Bundle
#!/usr/bin/env ruby
require 'benchmark'
REGEXPS = [
/^no such file to load -- (.+)$/i,
/^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i,
/^Missing API definition file in (.+)$/i,
/^cannot load such file -- (.+)$/i,
]
@dennmart
dennmart / changes.md
Created November 29, 2012 21:40 — forked from funny-falcon/changes.md
Performance patch for ruby-1.9.3-p327

Changes:

  • this version includes backport of Greg Price's patch for speedup startup http://bugs.ruby-lang.org/issues/7158 .

    ruby-core prefers his way to do thing, so that I abandon cached-lp and sorted-lf patches of mine.

  • this version integrates 'array as queue' patch, which improves performance when push/shift pattern is heavily used on Array.

    This patch is accepted into trunk for Ruby 2.0 and last possible bug is found by Yui Naruse. It is used in production* for a couple of months without issues even with this bug.

@dennmart
dennmart / random_emoji.rb
Last active August 29, 2015 13:56 — forked from hrp/emojibomb.rb
Gets a random emoji from http://www.emoji-cheat-sheet.com/ and copy it to the clipboard (Mac Only).
#!/usr/bin/env ruby
require 'open-uri'
require 'nokogiri'
doc = Nokogiri::HTML(open("http://www.emoji-cheat-sheet.com/"))
emoji = doc.css('.name')
IO.popen('pbcopy', 'w') { |f| f << ":#{emoji.to_a.sample.text}:" }
puts "Copied to clipboard!"
@dennmart
dennmart / nginx
Created April 3, 2014 14:50 — forked from hisea/nginx
sudo cp nginx /etc/init.d/
sudo update-rc.d nginx defaults
sudo chmod +x /etc/init.d/nginx
/etc/init.d/nginx start