Skip to content

Instantly share code, notes, and snippets.


Max Chernyak maxim

Block or report user

Report or block maxim

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View foobar.rb
module Widgets
def self.extended(base)
class << base
attr_accessor :widgets
base.widgets = {}
def add_widget(name, widget)
View gary.rb
["a b.c d.e"[/\.(\S+)$/, 1].split('.'), $`].reverse
View mock_warden.rb
class ActionController::TestCase
# setup :mock_warden
teardown :cleanup_warden_env
def warden
@_warden ||= mock
def mock_warden_for(*scopes)
scopes.each do |scope|
View server_restarter
#!/usr/bin/env ruby
# usage: script/server_restarter
# Rails autoloading, while nice in theory, frequently doesn't work. Since Rails 2.3+
# is so fast when completely reloading the server, I wrote this script to listen to the
# given directories, and kill/restart the server when any file is changed.
# It's quick, simple, and it reliably reloads your application when changes are made.
You can’t perform that action at this time.