Skip to content

Instantly share code, notes, and snippets.

View blowmage's full-sized avatar

Mike Moore blowmage

View GitHub Profile
@SamSaffron
SamSaffron / referring_paths.rb
Last active June 13, 2018 18:36
referring_paths.rb
require 'objspace'
class A
attr_accessor :b
end
class B
attr_accessor :c
end
RUBY_GC_HEAP_FREE_SLOTS: 600000
RUBY_GC_HEAP_GROWTH_FACTOR: 1.25
RUBY_GC_HEAP_GROWTH_MAX_SLOTS: 200000
RUBY_GC_HEAP_INIT_SLOTS: 600000
RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR: 1.3
RUBY_GC_MALLOC_LIMIT: 16000000
RUBY_GC_MALLOC_LIMIT_MAX: 32000000
RUBY_GC_OLDMALLOC_LIMIT: 16000000
RUBY_GC_OLDMALLOC_LIMIT_MAX: 32000000
@rushiagr
rushiagr / gist:8573862
Created January 23, 2014 06:27
Things to be done in AWS API of OpenStack, with respect to Cinder (block storage)
List of work to be done
-----------------------
CreateVolume - None
CreateSnapshot - None
DeleteVolume - None
DeleteSnapshot - None
AttachVolume None
DetachVolume - None
DescribeVolumes
###
# Execute tests in parallel using multiple processes. Uses DRb to communicate
# between processes over a unix socket.
gem 'minitest', '~> 5.1.0'
require 'minitest'
require 'minitest/spec'
require 'minitest/mock'
require 'drb'
require 'drb/unix'
require 'nokogiri'
require 'open-uri'
words = Hash.new {|h,k| h[k] = 0}
(1971..2013).each do |year|
["04","10"].each do |month|
talk_list = Nokogiri::HTML(open("http://www.lds.org/general-conference/sessions/#{year}/#{month}?lang=eng"))
talk_list.css("a.print").each do |link|
talk = Nokogiri::HTML(open(link.attributes["href"].value))
@andkerosine
andkerosine / raskell.rb
Created August 15, 2012 05:56
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@