This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActionControllerExtensions | |
def self.included(base) | |
base::Dispatcher.send :include, DispatcherExtensions | |
end | |
module DispatcherExtensions | |
def self.included(base) | |
base.send :before_dispatch, :set_session_domain | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActionControllerExtensions | |
def self.included(base) | |
base::Dispatcher.send :include, DispatcherExtensions | |
end | |
module DispatcherExtensions | |
def self.included(base) | |
base.send :before_dispatch, :set_session_domain | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'activesupport' | |
require 'dispatcher' | |
module ActionController | |
class Dispatcher | |
def set_session_domain | |
ActionController::Base.session_options[:session_domain] = "#{@request.domain}" | |
end | |
before_dispatch :set_session_domain | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'dispatcher' | |
module ActionController | |
class Dispatcher | |
def set_session_domain | |
ApplicationController.session_options.update( | |
:session_domain => "#{@request.host.gsub(/^[^.]*/, '')}" | |
) | |
end | |
before_dispatch :set_session_domain |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# The script that give you focus! | |
# Create a text file that contains sites want to give yourself | |
# access to only during certain times of day. | |
# | |
# The file will look like this: | |
# 12 news.ycombinator.com | |
# 11-13,19-21 twitter.com | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sudo | |
for x in {0..9} {a..z}; do hanna --gems `gem list | cut -f 1 -d "(" | grep ^$x | tr "\n" " "`; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows could not start because the following file is missing or corrupt: | |
<windows root>\system32\hal.dll | |
Please re-install a copy of the above file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd vendor/plugins | |
$ git clone git://github.com/thoughtbot/hoptoad_notifier.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ script/plugin install git://github.com/thoughtbot/hoptoad_notifier.git | |
Plugin not found: ["git://github.com/thoughtbot/hoptoad_notifier.git"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sake rails:check_syntax | |
# based on this rake task: http://moourl.com/s2dnw | |
# non-copyright (c) 2008 rodrigo franco <[email protected]> | |
namespace :rails do | |
task :load_requirements_and do | |
require 'erb' | |
require 'open3' | |
require 'yaml' | |
end |