Skip to content

Instantly share code, notes, and snippets.

@deepblue
deepblue / README.md
Last active December 16, 2015 08:59
ExceptionNotifier::LogNotifier

exception_notification의 간단한 확장으로 이럴 때 사용할 수 있겠다.

  • 좀 더 자세하게 exception log를 남겨두고 싶을 때
  • 메일을 보내는 등의 액션은 따로(ex. graylog2 or fluentd) 하고 싶을 때
@deepblue
deepblue / devise.rb
Created August 3, 2011 01:53
In test-mode we don't care is the test data includes easy-to-brute-force passwords. See http://goo.gl/wQMGl
# Don't need passwords in test DB to be secure, but we would like 'em to be
# fast -- and the stretches mechanism is intended to make passwords
# computationally expensive.
module Devise
module Models
module DatabaseAuthenticatable
def valid_password?(password)
return false if encrypted_password.blank?
Devise.secure_compare(password, self.encrypted_password)
end
@deepblue
deepblue / redis_pubsub.rb
Created July 8, 2011 03:29
Redis PubSub client with ruby/cool.io (cool.io is a high performance event library for Ruby built on top of libev)
require 'rubygems'
require 'cool.io'
require "redis/connection/command_helper"
class RedisPubsub < Cool.io::TCPSocket
include ::Redis::Connection::CommandHelper
event_callback :on_subscribe, :on_unsubscribe, :on_message
attr_accessor :args
def subscribe(*channels)
@deepblue
deepblue / gist:1016413
Created June 9, 2011 09:27
Install ruby 1.9.2 with rvm
rvm get head
rvm reload
rvm cleanup all
rvm package install readline
curl https://raw.github.com/gist/1008945/7532898172cd9f03b4c0d0db145bc2440dcbb2f6/load.patch > /tmp/load.patch
curl https://raw.github.com/gist/856296/patch-1.9.2-gc.patch > /tmp/gc.patch
rvm install ruby-1.9.2-p180 --patch /tmp/load.patch,/tmp/gc.patch --with-readline-dir=$rvm_path/usr -n patched
rvm --create 1.9.2-patched@dev --default