Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am danteregis on github.
  • I am danteregis (https://keybase.io/danteregis) on keybase.
  • I have a public key ASAhS23ohVws0rr-JsBkFNY2Sp01YwVQOZuQfSg3LV4w1Qo

To claim this, I am signing this object:

@danteregis
danteregis / gist:1109375
Created July 27, 2011 13:41 — forked from davithss/gist:1108199
models and action mailer
#sendemail.rb
class Sendemail < ActiveRecord::Base
has_many :newsletters, :dependent => :destroy
validates_presence_of :subject, :body
after_create :deliver_notification
@danteregis
danteregis / gist:1091114
Created July 19, 2011 01:32
installing mysql on snow leopard
ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql-5.1.54-osx10.6-x86_64/bin/mysql_config
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
local LIGHT_GREEN="\[\033[1;32m\]"
module ParameterableFlash #ugly name
def self.included(base)
base.prepend_before_filter :catch_flash_from_params
end
def catch_flash_from_params
detected_flash_message = false
params.each do |key, value|
key = key.to_s