Skip to content

Instantly share code, notes, and snippets.

Takashi Chiba tachiba

Block or report user

Report or block tachiba

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

Keybase proof

I hereby claim:

  • I am tachiba on github.
  • I am tachiba ( on keybase.
  • I have a public key ASAgFz1i_EOgBjjd0Vu-U4QzU9873NCo7U9bn-uzVoGdlwo

To claim this, I am signing this object:

View raven-config.html
<!-- Raven.js Config -->
<script src="{{ JS_PATH }}/lib/raven.js" type="text/javascript"></script>
<script type="text/javascript">
// Ignore list based off:
var ravenOptions = {
// Will cause a deprecation warning, but the demise of `ignoreErrors` is still under discussion.
// See:
ignoreErrors: [
// Random plugins/extensions
View specs.rb
# post_concatnator_spec.rb
# encoding: utf-8
require 'spec_helper'
module Moge
class PostString
def initialize
@body = 'hogehoge'
@nickname = 'mogemoge'
View raise_nil.rb
raise nil
#= > TypeError: exception object expected
tachiba / resolve_replace_patch_for_ruby_2_0_0.rb
Created May 5, 2013
monkeypatch for resolve-replace on ruby2.0.0p0
View resolve_replace_patch_for_ruby_2_0_0.rb
# SEE:
class TCPSocket < IPSocket
def initialize(host, serv, *rest)
rest[0] = IPSocket.getaddress(rest[0]) if rest[0]
#rest[0] = IPSocket.getaddress(rest[0]) unless rest.empty?
original_resolv_initialize(IPSocket.getaddress(host), serv, *rest)
tachiba / gitlab_resque.rb
Created Jan 29, 2013
god > gitlab-resuqe
View gitlab_resque.rb
app_root = "/home/gitlab/gitlabhq"
# SEE: do |w| = "gitlab-resque"
w.interval = 30.seconds
w.dir = app_root
w.env = {
"QUEUE" => 'post_receive,mailer,system_hook',
tachiba / gitlab.rb
Created Jan 29, 2013
god > gitlab.rb
View gitlab.rb
app_root = "/home/gitlab/gitlabhq" do |w| = "gitlab"
w.interval = 30.seconds
w.start_grace = 10.seconds
w.restart_grace = 10.seconds
w.dir = app_root
w.env = {

Using rails_admin without devise

Having a buckload of code to authorize users on your application is something you may like or not. Speaking for myself I hate it. But I still love rails_admin, here's how you install it without devise. Thanks to phoet for providing the hints in the gist I have forked from.

Add RailsAdmin to your Gemfile

do NOT add devise

gem "rails_admin", :git => "git://"
View base.rb
require 'open-uri'
require 'timeout'
require 'resolv-replace'
require 'mechanize'
module Parser
module Base
attr_reader :current_html, :agent
USER_AGENT = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1092.0 Safari/536.6"
View monitor-redis.rb
# Redis
%w{6379}.each do |port| do |w| = "redis"
w.interval = 30.seconds
w.start = "/etc/init.d/redis start"
w.stop = "/etc/init.d/redis stop"
w.restart = "/etc/init.d/redis restart"
w.start_grace = 10.seconds
w.restart_grace = 10.seconds
You can’t perform that action at this time.