Skip to content

Instantly share code, notes, and snippets.

View edward's full-sized avatar

Edward Ocampo-Gooding edward

View GitHub Profile
@edward
edward / unused_gems.rb
Created February 22, 2014 13:26
Lists unloaded gems
require "bundler"
bundled_gems = Bundler.load.specs.sort_by { |s| s.name }.map { |s| s.name }
# Which gem paths are in the Gemfile.lock that are missing from the loaded files?
# gem_paths - loaded files = unused gems
loaded_gems = $LOADED_FEATURES.map {|lf| lf[/gems\/2.1.0\/gems\/(?<gem>\S*?)-\d.+\//, "gem"] }.compact.uniq
unused_gems = bundled_gems - loaded_gems

Keybase proof

I hereby claim:

  • I am edward on github.
  • I am edward (https://keybase.io/edward) on keybase.
  • I have a public key whose fingerprint is 3751 809D D669 DAE7 E621 E58F 0D34 E300 AF97 E5DD

To claim this, I am signing this object:

[
{ "keys": ["ctrl+l"], "command": "insert", "args": {"characters": " => "}},
{ "keys": ["ctrl+super+r"], "command": "reveal_in_side_bar"},
{ "keys": ["ctrl+shift+."], "command": "erb" },
// swap the keybindings for paste and paste_and_indent
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" }
]
This file has been truncated, but you can view the full file.
--- gedsOpenData-cleaned.csv 2014-03-01 15:19:18.000000000 -0500
+McGraw,Neil,,,,,,Counsel,Avocat,613-843-5547,613-825-1241,,,,,,"73 Leikin Drive, 2nd Floor","73, promenade Leikin, 2e étage",Canada,Canada,Ontario,Ontario,Ottawa,Ottawa,K1A 0R2,,,,,,,,,,,,JUS-JUS,Justice Canada,Justice Canada
+McGraw,Nicole,,,,,,Human Resources Coordinator,Coordonatrice en ressources humaines,(506) 777-6044,(506) 777-6059,,,,,nicole.mcgraw@agr.gc.ca,459 Paul Street,459 rue Paul,Canada,Canada,New Brunswick,Nouveau-Brunswick,Dieppe,Dieppe,E1A 5R4,,,,,,,,,,,,AGR-AGR,Agriculture and Agri-Food Canada,Agriculture et agroalimentaire Canada
+McGraw,Sylvie,,,,,,Contribution Accounting Specialist,Spécialiste de la comptabilité des cotisations,(506) 533-5601,(506) 533-5641,,,,,Sylvie.McGraw@pwgsc-tpsgc.gc.ca,10 Weldon Street,"10, rue Weldon",Canada,Canada,New Brunswick,Nouveau-Brunswick,Shediac,Shediac,E4P 2X7,,,,,,,,,,,,PWGSC-TPSGC,Public Works and Government Services Canada,Travaux publics et Services gouvernementaux Canada
+McGraw,Yvon
email = dispute_email
f = Tempfile.new(['html-email-test', '.html'], Rails.root + 'tmp')
f.write(email.html_part.body)
basename = File.basename(f.path)
puts "file:///Users/edward/Shopify/vagrant/src/shopify/tmp/#{basename}"
require 'rubygems'
require 'bundler/setup'
require 'css_parser'
class String
CSS_CLASS_REGEX = /\.[\w-]+/ix
CSS_ID_REGEX = /\#[\w-]+/ix
def css_classes
require 'nokogiri'
html = %(<div class="next-input-wrapper"><label class="next-label next-label--switch" for="radio-2"><input class="next-radio" id="radio-2" name="radio-group" type="radio" value="2" /><span class="next-radio--styled"></span>A longer label with text that wraps (just resize the iframe to see me in action!)</label></div>)
doc = Nokogiri::XML(html,&:noblanks)
puts doc.to_xml
__END__
--- simplerdb-0.2/lib/simplerdb/db.rb 2008-03-15 17:56:16.000000000 +0000
+++ simplerdb-0.2/lib/simplerdb/db.rb 2008-10-20 12:03:37.000000000 +0100
@@ -128,15 +128,22 @@
attribute_params.each { |attr| item.put_attribute(attr.to_attr, attr.replace) }
end
- def delete_attributes(domain_name, item_name, attributes)
+ def delete_attributes(domain_name, item_name, attributes = [])
domain = @domains[domain_name]
item = domain.items[item_name]
@edward
edward / gist:19899
Created October 26, 2008 15:12 — forked from guenin/gist:19898
def make_sandwiches(however_many)
sandwiches = []
however_many.times do
sandwiches << make_sandwich { |sandwich| yield sandwich }
end
sandwiches
end
def make_sandwich
puts "makin a sandwich"
def make_sandwiches(however_many)
sandwiches = []
however_many.times do
sandwiches << make_sandwich { |sandwich| yield sandwich }
end
sandwiches
end
def make_sandwich
sandwich = "=======\n"