Skip to content

Instantly share code, notes, and snippets.

View billthompson's full-sized avatar

Bill Thompson billthompson

View GitHub Profile
@billthompson
billthompson / ruby_try_vs_fetch_benchmark.rb
Created January 12, 2022 16:26
Benchmarking Ruby's fetch against ActiveSupport's try.
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'benchmark'
require 'active_support/core_ext/object/try'
n = 5000000
puts "Key not found:"
sad_hash = {}

Keybase proof

I hereby claim:

  • I am billthompson on github.
  • I am bulletbill (https://keybase.io/bulletbill) on keybase.
  • I have a public key whose fingerprint is 4296 8C9D 737F B9C0 360E B1C4 B95F 73E1 AA90 C3F2

To claim this, I am signing this object:

@billthompson
billthompson / linkedin-recruiter-auto-message
Last active August 29, 2015 14:08
LinkedIn Recruiter Auto Message. Bookmarklet for auto-replying to generic LI invite/recruiter requests.
(function() {
var namePieces,
firstName,
greeting,
message_body,
salutation = 'Best,',
myName = 'Bill',
fullMessage;
function getRecruiterName() {
@billthompson
billthompson / 100-select-options.html
Created June 5, 2014 13:28
A select element with 100 options. Never know when you need to test the behavior of a large select element :)
<select>
<option val="1">Option 1</option>
<option val="2">Option 2</option>
<option val="3">Option 3</option>
<option val="4">Option 4</option>
<option val="5">Option 5</option>
<option val="6">Option 6</option>
<option val="7">Option 7</option>
<option val="8">Option 8</option>
<option val="9">Option 9</option>
// Unable to get around Github's content security policy, so made this a bookmark instead.
// javascript:function GithubUserscript(){var s=$(".toc-diff-stats","#toc");s.append('<a href="#" class="minibutton right us-hide-file-diffs" style="margin-right: 10px;">Collapse File Diffs</a>'),s.append('<a href="#" class="minibutton right us-show-file-diffs" style="margin-right: 10px;">Show File Diffs</a>');var e=$(".us-hide-file-diffs"),i=$(".us-show-file-diffs"),t=$(".file.js-details-container");$("#toc").on("click",".us-hide-file-diffs",function(s){s.preventDefault(),$(this).hide(),i.show(),t.find(".data").addClass("suppressed"),t.find(".render-wrapper").addClass("suppressed data")}),$("#toc").on("click",".us-show-file-diffs",function(s){s.preventDefault(),$(this).hide(),e.show(),$(".file.js-details-container").find(".data").removeClass("suppressed"),$(".file.js-details-container").find(".render-wrapper").removeClass("suppressed data")}),$("#files").on("click",".us-toggle-file-diff",function(){var s=$(this).closes
@billthompson
billthompson / git-intro.md
Created February 19, 2013 12:11
Intro to Git