Skip to content

Instantly share code, notes, and snippets.

View yemartin's full-sized avatar

Yves-Eric Martin yemartin

View GitHub Profile
@aelesbao
aelesbao / gem-list-native.rb
Created May 27, 2014 19:38
List gems with native extensions
require 'rubygems'
specs_with_extensions = Gem::Specification.each.select { |spec| spec.extensions.any? }
specs_with_extensions.each do |spec|
puts "#{spec.name} (extensions: #{spec.extensions.inspect})"
end
@jasonlong
jasonlong / Default (OSX).sublime-keymap
Created April 16, 2013 11:53
A simple way to toggle between dark and light themes in Sublime Text 2.
// Copy this to your keybindings (Preferences > Key Bindings - User)
// Change the keybinding, color schemes, and themes to your preferences
{ "keys": ["ctrl+1"], "command": "toggle_color_scheme",
"args": {
"light_color_scheme": "Packages/User/Espresso Soda.tmTheme",
"dark_color_scheme": "Packages/User/Monokai Soda.tmTheme",
"light_theme": "Soda Light.sublime-theme",
"dark_theme": "Soda Dark.sublime-theme"
}
@mreinsch
mreinsch / rescue_from_defaults.rb
Last active June 3, 2023 00:05
the way we are catching errors and rendering custom error pages for http://www.doorkeeperhq.com/
# encoding: UTF-8
#
# This file is in: lib/rescue_from_defaults.rb
#
# To use it, include the RescueFromDefaults in the ApplicationController (see below for example)
#
# To test it we are using rspec and steak. See below for examples.
#
class AccessDenied < RuntimeError
end