Skip to content

Instantly share code, notes, and snippets.

@balexand
balexand / README.md
Last active August 11, 2016 20:25 — forked from mbostock/.block

Forked from this, but added slider.

@balexand
balexand / gem-reset.rb
Last active December 14, 2015 07:49 — forked from nixpulvis/gem-reset
#!/usr/bin/env ruby
# Remove all gems EXCEPT defaults :)
`gem list -d`.split(/\n\n^(?=\w)/).each do |data|
match = data.match(/(?<name>([^\s]+)) \((?<versions>.*)\)/)
name = match[:name]
versions = match[:versions].split(', ')
if match = data.match(/^.*\(([\d\.]*),? ?default\): .*$/)
next if match[1].empty? # it's the only version if this match is empty