Skip to content

Instantly share code, notes, and snippets.

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

Oleh Makarov lgmkr

🏠
Working from home
View GitHub Profile

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh root@123.123.123.123

Add ssh fingerprint and enter password provided in email

iTerm2 – Useful Shortcuts (Mac OS X)

with a hat tip to Sublime Text 2 Shortcuts

The Awesome

⌘; autocomplete
⌘⌥B instant replay
⌘⌥E search across all tabs
Boot2Docker-cli version: v1.7.1
Git commit: 8fdc6f5
docker: 1.7.1, build 786b29d
boot2docker ssh
sudo curl -o /var/lib/boot2docker/profile https://gist.githubusercontent.com/garthk/d5a17007c277aa5c76de/raw/3d09c77aae38b4f2809d504784965f5a16f2de4c/profile
sudo halt
#maybe reboot macosx
#reboot(powerof) boot2docker vm manualy in VM GUI
boot2docker up

Figure out a good standard for how to use the HTTP response codes in a 'truly RESTful' (Now called 'Hypermedia API' apparently) way.

Summary

@lgmkr
lgmkr / ruby_constant.rb
Created September 1, 2011 11:40 — forked from marshluca/ruby_constant.rb
constant in Rails
Loading development environment (Rails 2.3.8)
>> Rails.env
=> "development"
>> RAILS_ENV
=> "development"
>> RUBY_VERSION
=> "1.8.7"
@lgmkr
lgmkr / gist:1225616
Created September 18, 2011 22:13
rvm info in terminal promt
PS1="\$(~/.rvm/bin/rvm-prompt) $PS1"
@lgmkr
lgmkr / asdasdasd
Created October 27, 2011 12:59
asdasdasd
asdasdasdasd
@lgmkr
lgmkr / gitconfig
Created October 27, 2011 13:01
git aliases, save in ~/.gitconfig
[alias]
a = add
s = status
st = stash
sta = stash apply
r = rebase
m = merge
ms = merge --squash
# Branching
@lgmkr
lgmkr / ruby-1.9-tips.rb
Created July 7, 2012 12:42 — forked from igrigorik/ruby-1.9-tips.rb
Ruby 1.9 features, tips & tricks you may not know about...
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
@lgmkr
lgmkr / gist:3082258
Created July 10, 2012 09:22
ruby 1.9.3-p194 with performance patches built into a .deb package with fpm
# AMI: ubuntu/images/ebs/ubuntu-precise-12.04-amd64-server-20120424 (ami-a29943cb)
#
# Part 1: Make a deb package of ruby:
# Get our deps
sudo apt-get install python-setuptools python-dev build-essential dpkg-dev libopenssl-ruby ruby1.8-dev rubygems bison autoconf zlib1g zlib1g-dev libreadline6 libreadline6-dev libssl0.9.8 libssl-dev
# Get ruby
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
tar -zxvf ruby-1.9.3-p194.tar.gz