Skip to content

Instantly share code, notes, and snippets.

View edward's full-sized avatar

Edward Ocampo-Gooding edward

View GitHub Profile
@edward
edward / launch.json
Last active August 19, 2022 08:31
Visual Studio Code debugging for Exercism
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest All",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"--runInBand"
require 'rubygems'
require 'benchmark/ips'
class ExampleClass
def foo; 42; end
end
module ExampleMixin
def foo; 43; end
end

Here’s the idea, inspired by the iOS game Lifeline: Silent Night:

  • You see a poster with the word “For adventure, text 613 ### ####”
  • You text the number and it replies with a message. This message compels you to a certain vista or vantage point in Ottawa via detailed instructions or inspires you to seek out a personal place. The messages might only be sent at night or something. Not sure about this part. Also not sure if we want to gather people playing in one spot or not. (Having strangers run into each other while playing a game like this sounds neat to me but I also want to keep it safe so I don’t know about this part yet.)
  • The game leads you through a mystery with a leadup to a climax and a resolution. Let’s go with 7 stops.
  • Players can leave a voicemail about their experience and are prompted for a donation to help out with messaging fees.
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__
require 'rubygems'
require 'bundler/setup'
require 'css_parser'
class String
CSS_CLASS_REGEX = /\.[\w-]+/ix
CSS_ID_REGEX = /\#[\w-]+/ix
def css_classes
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}"
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
[
{ "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" }
]

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:

@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