Skip to content

Instantly share code, notes, and snippets.

View borisd's full-sized avatar

Boris Dinkevich borisd

View GitHub Profile
@borisd
borisd / gist:3274046
Created August 6, 2012 12:23 — forked from dpaluy/gist:3273630
Heroku SHARED DATABASE migration to PostgreSQL
if [ $# -eq 0 ] ; then
echo "No args given"
echo "Missing Heroku app name"
exit 1
fi
APP_NAME="--app ${1}"
echo "heroku addons:add heroku-postgresql:dev ${APP_NAME}"
heroku addons:add heroku-postgresql:dev ${APP_NAME}
@borisd
borisd / gist:4390341
Last active December 10, 2015 05:48
ZSH
===============
- Typo correction:
crl google.com
- Really smart completion
kill [tab]
ls - [tab S]
- History accross sessions
rake aborted!
500 Command not implemented
/usr/local/lib/ruby/1.9.1/net/smtp.rb:954:in `check_response'
/usr/local/lib/ruby/1.9.1/net/smtp.rb:923:in `getok'
/usr/local/lib/ruby/1.9.1/net/smtp.rb:913:in `quit'
/usr/local/lib/ruby/1.9.1/net/smtp.rb:619:in `do_finish'
/usr/local/lib/ruby/1.9.1/net/smtp.rb:528:in `ensure in start'
/usr/local/lib/ruby/1.9.1/net/smtp.rb:528:in `start'
/app/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/network/delivery_methods/smtp.rb:144:in `deliver!'
/app/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/message.rb:245:in `deliver!'
class ReportsMailer < ActionMailer::Base
default :from => "iPawn Reports <reports@ipawn.com>"
def report(report, data)
@report = report
attachments["report.csv"] = { :data => data, :mime_type => 'text/csv' }
mail(:to => report.emails,
:subject => "iPawn report: #{@report.name}")
end
end
----- REPORT DATA ----------
#<Mail::Message:41232180, Multipart: true, Headers: <From: iPawn Reports <reports@ipawn.com>>, <to: avi@ipawn.com, benny@ipawn.com, michael@ipawn.com
>, <Subject: iPawn report: Weekly Funnel - Affiliates - Linkco>, <Mime-Version: 1.0>, <Content-Type: multipart/mixed; boundary="--==_mimepart_50e9a1fd400a7_2c0614c679cc"; charset=UTF-8>>
----------------------------
---
headers:
From: iPawn Reports <reports@ipawn.com>
to: |
avi@ipawn.com, benny@ipawn.com, michael@ipawn.com
Pry.config.editor = "vim"
begin
require 'hirb'
rescue LoadError
# Missing goodies, bummer
end
if defined? Hirb
# Dirty hack to support in-session Hirb.disable/enable
Country Name;ISO 3166-1-alpha-2 code
AFGHANISTAN;AF
ÅLAND ISLANDS;AX
ALBANIA;AL
ALGERIA;DZ
AMERICAN SAMOA;AS
ANDORRA;AD
ANGOLA;AO
ANGUILLA;AI
ANTARCTICA;AQ
<label for='field' tooltip='hello world'>Bla bla</label>
Becomes:
<span class='tooltip'>
<label for='field' tooltip='hello world'>Bla bla</label>
<div class='something'>hello world</div>
</span>
# Your code
def foo(a,b,c)
if a > b
return a
end
end
# One line
def foo(a,b,c)
return a if a > b

Download & Install

Rails Installer

  • Do next->next->next on everything
  • When asks for name and email for git, enter those

Using it

  • You start it by running "Command prompt with Ruby on Rails"