Skip to content

Instantly share code, notes, and snippets.

View tomoyukiinoue's full-sized avatar

Tomoyuki INOUE tomoyukiinoue

  • Beartail
  • Japan, Tokyo, Shinagawa
View GitHub Profile
@tomoyukiinoue
tomoyukiinoue / 00_prepare
Created October 14, 2012 04:08
Install Rails 3.2.8 for Mac OS X Mountain Lion (10.8.2)
1. Install Xcode 4.5.1 from AppStore.
1. Install Command Line Tools via Xcode preferences.
@tomoyukiinoue
tomoyukiinoue / gist:3887363
Created October 14, 2012 04:40
Install git-flow for Mac OS X Mountain Lion (10.8.2)
$ brew update
$ brew install git-flow
$ cd myapp
$ git init
$ git init flow
No branches exist yet. Base branches must be created now.
Branch name for production releases: [master]
Branch name for "next release" development: [develop]
How to name your supporting branch prefixes?
@tomoyukiinoue
tomoyukiinoue / gist:3888484
Created October 14, 2012 12:52
git rm all files without git rm
git status | grep deleted: | awk '{print $3}' | xargs git rm
@tomoyukiinoue
tomoyukiinoue / gist:3888525
Created October 14, 2012 13:13
QRCode on rails
def generate_qr_image( url )
raw "http://chart.apis.google.com/chart?chs=150x150&cht=qr&chl=#{url}&choe=UTF-8"
end
@tomoyukiinoue
tomoyukiinoue / gist:3891816
Created October 15, 2012 10:15
run the rails server with the production mode
$ rails s -e production
@tomoyukiinoue
tomoyukiinoue / gist:3892167
Created October 15, 2012 12:16
Get own private IP address
require 'socket'
def my_first_private_ipv4
Socket.ip_address_list.detect{|intf| intf.ipv4_private?}
end
@tomoyukiinoue
tomoyukiinoue / .bash_profile
Created October 29, 2012 03:46
My mac's default profile
PS1="\W $ "
alias ll='ls -l'
alias ..="cd .."
alias la="ls -la"
export CLICOLOR=1
export LSCOLORS=ExGxcxdxCxegedabagacad
alias s="'/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl' -w"
@tomoyukiinoue
tomoyukiinoue / Preferences.sublime-settings
Created October 30, 2012 00:44
Sublime Text 2 User Preferences
// Settings in here override those in "Default/Preferences.sublime-settings", and
// are overridden in turn by file type specific settings.
{
// The number of spaces a tab is considered equal to
"tab_size": 2,
// Set to true to insert spaces when tab is pressed
"translate_tabs_to_spaces": false
}
@tomoyukiinoue
tomoyukiinoue / gist:4173349
Created November 30, 2012 02:14
How to pass inputing the username and password when you push to the repository using https from mac os x.
$ git clone git://github.com/gitster/git
$ cd git/contrib/credential/osxkeychain
$ make
$ sudo cp git-credential-osxkeychain /usr/local/bin/git-credential-osxkeychain
$ sudo chmod 755 /usr/local/bin/git-credential-osxkeychain
$ sudo git config --global credential.helper osxkeychain
@tomoyukiinoue
tomoyukiinoue / gist:4304007
Created December 16, 2012 07:27
Install Python and Django for Mac OS X 10.8
# Install Python 2.7.3 via Homebrew
$ brew install python
$ echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bash_profile
$ source ~/.bash_profile
$ python --version
Python 2.7.3
# Install Django 1.4.3 by easy_install
$ sudo easy_install django
$ sudo easy_install virtualenv