Skip to content

Instantly share code, notes, and snippets.

View rust's full-sized avatar
🏠
Working from home

Shinichiro OGAWA rust

🏠
Working from home
View GitHub Profile
### Keybase proof
I hereby claim:
* I am rust on github.
* I am shinichiro_ogawa (https://keybase.io/shinichiro_ogawa) on keybase.
* I have a public key ASD04EcOzXjQX-oFtq9hRSDW-m3aQU72hiD1kmd4j-SvVAo
To claim this, I am signing this object:
@rust
rust / numerals.rb
Created June 2, 2012 05:20
English Numerals
#!/usr/bin/env ruby
require 'pp'
num = ARGV[0]
num = num.to_i
NUMBERS = {
1 => 'one',
2 => 'two',
3 => 'three',
set :bundle_cmd, "/opt/local/ruby193/bin/bundle"
set :unicorn_binary, "unicorn"
set :unicorn_config, "config/unicorn.rb"
set :unicorn_pid, "tmp/pids/unicorn.pid"
namespace :deploy do
task :start, :roles => :app, :except => { :no_release => true } do
try_sudo "sh -c 'cd #{current_path} && PATH=#{binary_path}:$PATH #{ruby_path} #{unicorn_rails_path} -c #{current_path}/#{unicorn_config} -E #{deploy_environment} -D'"
end
@rust
rust / _paginator.html.haml
Created December 22, 2011 07:24
lib/kaminari_patch.rb
= paginator.render do
%div
= prev_page_tag
= (current_page.to_i - 1) * per_page + 1
\-
= [current_page.to_i * per_page, total_count].min
\/
= total_count
= next_page_tag
@rust
rust / emacs.rb
Created August 6, 2011 03:59 — forked from pingles/emacs.rb
Homebrew Emacs for OSX Lion with native full-screen
require 'formula'
class Emacs < Formula
url 'http://ftp.gnu.org/pub/gnu/emacs/emacs-23.3a.tar.bz2'
md5 'f2cf8dc6f28f8ae59bc695b4ddda339c'
homepage 'http://www.gnu.org/software/emacs/'
if ARGV.include? "--use-git-head"
head 'git://repo.or.cz/emacs.git'
else
% ruby -v
ruby 1.9.2dev (2010-07-11 revision 28618) [x86_64-linux]
% gem install --no-ri --no-rdoc capistrano capistrano_ext capistrano_colors
Successfully installed net-ssh-2.0.23
Successfully installed net-sftp-2.0.4
Successfully installed net-scp-1.0.2
Successfully installed net-ssh-gateway-1.0.1
Successfully installed highline-1.6.1
Successfully installed capistrano-2.5.19
Successfully installed capistrano_colors-0.5.2
% gem list
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.0.rc, 3.0.0.beta4)
actionpack (3.0.0.rc, 3.0.0.beta4)
activemodel (3.0.0.rc, 3.0.0.beta4)
activerecord (3.0.0.rc, 3.0.0.beta4)
activeresource (3.0.0.rc, 3.0.0.beta4)
diff --git a/lib/jpmobile/rack.rb b/lib/jpmobile/rack.rb
index c4c6a66..09187bc 100644
--- a/lib/jpmobile/rack.rb
+++ b/lib/jpmobile/rack.rb
@@ -7,13 +7,35 @@ module Jpmobile
autoload :ParamsFilter, 'jpmobile/rack/params_filter.rb'
autoload :Filter, 'jpmobile/rack/filter.rb'
autoload :Config, 'jpmobile/rack/config.rb'
+
+ module_function
diff --git a/lib/jpmobile/hook_action_controller.rb b/lib/jpmobile/hook_action_controller.rb
index cca89d1..59d89f1 100644
--- a/lib/jpmobile/hook_action_controller.rb
+++ b/lib/jpmobile/hook_action_controller.rb
@@ -29,3 +29,26 @@ module ActionController
end
ActionController::Request.send :include, Jpmobile::Encoding
+
+module ActionDispatch
rust@:[~/Works/programs/gae/mybot]
% ls -la
total 8
drwxr-xr-x 3 rust staff 102 3 2 22:44 .
drwxr-xr-x 5 rust staff 170 2 25 20:46 ..
-rw-r--r-- 1 rust staff 2560 3 2 22:44 rails2_td_appengine.rb
rust@:[~/Works/programs/gae/mybot]
% which ruby
/opt/local/bin/ruby
rust@:[~/Works/programs/gae/mybot]