Skip to content

Instantly share code, notes, and snippets.

View mtodd's full-sized avatar
🔐
[redacted]

Matt Todd mtodd

🔐
[redacted]
View GitHub Profile
@skalnik
skalnik / bicycles.md
Last active December 19, 2015 11:49
Rapha Rising

To celebrate the 100th edition of the Tour de France, and the mountains that have made it legendary, Rapha and Strava are proud to announce Rapha Rising: La Centième.

In the week which starts on Bastille Day (14th-21st July), Rapha is challenging participating riders to climb the combined height, from sea level, of the Peyresourde, Ventoux and Col de Sarenne, all of which feature in this year’s race. The Peyresourde is one of the giants of the Pyrenees, which featured in the Tour's first excursion into the bear-infested mountains in 1910, while Mont Ventoux, the Giant of Provence, first appeared in the Tour in 1951, a year before Alpe d'Huez. Together, they've been the sites of some of the Tour's most famous battles. The Col de Sarenne, however, has never been scaled in the Tour. It’s a little known col, 1,999m high, that the pros will climb this year, having first climbed the Alpe. Descending on a road resurfaced especially for them, th

require 'rack'
# Track changes in rack requests and responses made by middleware.
#
# SomeMiddleware
# request: ...
# response: ...
# AnotherMiddleware
# request: ...
# response: ...
@rick
rick / github.com.js
Created September 19, 2013 22:04
dotjs file to mute unread github notifications on a repo
$("button.mark-all-as-read").parent().prepend('<button class="box-action mute-all-unread css-truncate tooltipped upwards" original-title="mute all unread notifications"> <span class="octicon octicon-mute"></span> </button>');
$('button.mute-all-unread').click(function(event) {
// mute all unread notifications
$(this).parent().parent().parent().find('li.unread').find('.js-mute-notification button').click();
return false;
});
@phurni
phurni / application.rb
Created May 16, 2014 21:22
override active_record.initialize_database in rails (rails4)
require File.expand_path('../boot', __FILE__)
require 'rails/all'
if ar_initdb = ActiveRecord::Railtie.initializers.find {|item| item.name == 'active_record.initialize_database'}
ActiveRecord::Railtie.initializers.delete(ar_initdb)
ActiveRecord::Railtie.initializer :after => ar_initdb.after do
ActiveSupport.on_load(:active_record) do
self.configurations = Rails.application.config.database_configuration
require 'active_support/all'
require 'active_record'
require 'logger'
ActiveRecord::Base.logger = Logger.new(STDOUT)
spec = { 'test' => {adapter: 'sqlite3', database: ':memory:'},
'test_readonly' => {adapter: 'sqlite3', database: ':memory:'},
'shared_test' => {adapter: 'sqlite3', database: ':memory:'},
'shared_test_readonly' => {adapter: 'sqlite3', database: ':memory:'}
module ActionControllerRedirectPatch
extend ActiveSupport::Concern
class BadRedirectTo < StandardError; end
included do
config_accessor :allowed_url_protocols
self.allowed_url_protocols = ["http", "https", "mailto"]
end
require "set"
module GitHub
module AttrIgnore
attr_reader :ignored_columns
def attr_ignore(*columns)
@ignored_columns ||= Set.new
@ignored_columns |= columns.map(&:to_s)
end
#!/bin/sh
set -e
# clone a bare repository, because even with `--no-checkout`, clone will create a
# folder for a working directory, and it will ignore the `--git-dir` option.
# but the restore all the configuration that would be there.
git clone --bare git@github.com:/ethomson/dotfiles .dotfiles.git
git --git-dir=.dotfiles.git config core.bare false
git --git-dir=.dotfiles.git config push.default simple
require 'connection_pool'
require 'redis'
require 'metriks'
class RedisClientWrapper
def initialize(options)
@options = options.delete(:pool)
@pool = ConnectionPool.new(@options) do
::Redis.new(options)
end
@fitnr
fitnr / systems.json
Created December 2, 2015 14:48
rapid transit systems included in http://fakeisthenewreal.org/subway
[
{
"city": "Amsterdam",
"urls": [
{
"link": "GVB",
"url": "http://www.gvb.nl/"
}
]
},