Skip to content

Instantly share code, notes, and snippets.

@timraymond
timraymond / desopafy.js
Created January 18, 2012 05:22
Remove SOPA overlay from Wikipedia pages
$("#mw-page-base, #mw-head-base, #content, #mw-head, #mw-panel, #footer").css("display", "inherit");
$("#mw-sopaOverlay").css("display", "none");
@timraymond
timraymond / gist:2048025
Created March 16, 2012 01:10
Sencha Example
Ext.define("app_namespace.model.model_name", {
extends: 'Ext.data.model',
config: {
fields: [
{ name: 'some_identifier', type: 'string' }
]}
})
Ext.define("app_namespace.store.store_name", {

Mark Bates - Keynote

Needs no introduction. Go watch it. It was an excellent introduction to the entire conference which many people that I talked to afterward enjoyed. I feel like people made an effort to be more outgoing in the hallway after watching his talk.

David Czerneki - Zero Downtime Deploys

@timraymond
timraymond / userscalable_yes.txt
Last active December 31, 2015 10:58
Bookmarklet to re-enable zoom. Useful for sites that annoyingly set userscalable=no without actually optimizing their content for iOS display.
javascript:document.querySelector('meta%5Bname=viewport%5D').setAttribute('content','width=device-width,initial-scale=1.0,maximum-scale=10.0,user-scalable=1');

Keybase proof

I hereby claim:

  • I am timraymond on github.
  • I am timraymond (https://keybase.io/timraymond) on keybase.
  • I have a public key whose fingerprint is 638C BA2C E35A 4B25 9419 0AD6 A3B3 91E8 EE65 2349

To claim this, I am signing this object:

-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using 1.5.2
New app detected loading default bundler cache
!
! Command: 'set -o pipefail; curl --fail --retry 3 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/ruby-2.0.0-p481-default-cache.tgz -s -o - | tar zxf -' failed unexpectedly:
!
! gzip: stdin: unexpected end of file
! tar: Child returned status 1
! tar: Exiting with failure status due to previous errors
@timraymond
timraymond / git-recent
Created August 19, 2014 13:47
Recent Branches
#!/bin/bash
git for-each-ref --format="%(committerdate:relative) | %(refname)" --sort=-committerdate refs/heads | sed '/master/d' | head -n 10
@timraymond
timraymond / Gemfile
Created May 1, 2015 19:15
CanCan Benchmark
source 'http://rubygems.org'
gem 'cancancan', path: "~/github/cancancan"
gem 'allocation_tracer'
gem 'benchmark-ips'
@timraymond
timraymond / ie9compatiblexhradapter.js
Created May 18, 2015 16:12
IE9 Compatible XHR Adapter
/**
* Connection class to use with the elasticsearch.js client for limited compatibility with
* IE 9 (also IE 8 is you include an es5 shim like https://github.com/es-shims/es5-shim).
*
* All connections from the browser, directly to elasticsearch, are assumed to be cross-domain
* and therefore suffer from a lack of support in legacy browsers. To prevent the client from
* behaving differently based on the browser version, the following limitations have been imposed
* on all requests:
*
* - only GET and POST are supported
@timraymond
timraymond / sum.rb
Created June 5, 2015 15:14
Possible expressions involving the digits 1-9 and operators "-" and "+"
def expressions(nums)
first, second = nums.slice(0, nums.length/2), nums.slice(nums.length/2, nums.length)
if first == ""
return [second]
end
left_sub = expressions(first)
right_sub = expressions(second)
exprs = []
left_sub.each do |l|
right_sub.each do |r|