Skip to content

Instantly share code, notes, and snippets.

View sydneyitguy's full-sized avatar

seb's sydneyitguy

  • Seoul, Korea
View GitHub Profile
@sydneyitguy
sydneyitguy / .bash_profile
Last active October 6, 2015 05:27
My Bash Profile
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1="\[\033[0;32m\]\w\[\033[00m\]\$(parse_git_branch)\\$ "
alias ll='ls -la'
alias l='ls -CF'
@sydneyitguy
sydneyitguy / gitconfig
Last active September 13, 2016 09:10
Git config file: .gitconfig
[user]
name = Sebastian Kim
email = email@gmail.com
[color]
status = auto
branch = auto
diff = auto
ui = auto
@sydneyitguy
sydneyitguy / install_image_magick_php
Last active October 7, 2015 02:58
Install ImageMagick with PHP using HomeBrew
brew install imagemagick
brew install imagick
cd /usr/lib/php/extensions/no-debug-non-zts-20090626
sudo ln -s /usr/local/Cellar/imagick/3.0.1/lib/php/extensions/imagick.so imagick.so
echo "extension='/usr/lib/php/extensions/no-debug-non-zts-20090626/imagick.so'" >> /usr/local/etc/php.ini
@sydneyitguy
sydneyitguy / ssh_config
Last active October 9, 2015 01:48
SSH Config
# ssh -f -N -L 3306:127.0.0.1:3306 dev@database.example.com
Host dev
HostName dev.example.com
LocalForward 3306 127.0.0.1:3306
User skim
@sydneyitguy
sydneyitguy / sphinx-macosx.sh
Created August 23, 2012 01:22 — forked from ubermuda/sphinx-macosx.sh
Installing sphinxsearch on macosx
# first sphinx
brew install sphinx
# the formula does not install libsphinxclient :/
wget http://sphinxsearch.com/files/sphinx-2.0.4-release.tar.gz
tar xzf sphinx-2.0.4-release.tar.gz
cd sphinx-2.0.4-release/api/libsphinxclient/
CXXCPP="gcc -E" ./configure --prefix=/usr/local
make
make install
@sydneyitguy
sydneyitguy / uninstall-node.sh
Created August 23, 2012 04:29 — forked from nicerobot/README.md
Mac OS X uninstall script for packaged install of node.js
#!/bin/sh
(( ${#} > 0 )) || {
echo 'DISCLAIMER: USE THIS SCRIPT AT YOUR OWN RISK!'
echo 'THE AUTHOR TAKES NO RESPONSIBILITY FOR THE RESULTS OF THIS SCRIPT.'
echo "Disclaimer aside, this worked for the author, for what that's worth."
echo 'Press Control-C to quit now.'
read
echo 'Re-running the script with sudo.'
echo 'You may be prompted for a password.'
sudo ${0} sudo
@sydneyitguy
sydneyitguy / http_status_code
Last active October 12, 2015 14:38
Rails HTTP Status Code to Symbol Mapping
Status Code Status Message Symbol
1xx Informational
100 Continue :continue
101 Switching Protocols :switching_protocols
102 Processing :processing
2xx Success
200 OK :ok
201 Created :created
202 Accepted :accepted
@sydneyitguy
sydneyitguy / rails_explain
Last active October 12, 2015 18:28
Rails Explain
ActiveRecord::Base.connection.execute('EXPLAIN QUERY PLAN SELECT * FROM users where id = 10')
= User.find(10).explain
@sydneyitguy
sydneyitguy / find.sh
Last active December 12, 2015 00:58
find -exec example
# Remove all Thumbs.db files reculsively from current directory
find ./ -name "Thumbs.db" -exec rm '{}' \;
@sydneyitguy
sydneyitguy / _useful_bash_commands
Last active December 14, 2015 18:49
Clear all rails log files under the current directory
# Remove all Thumbs.db files reculsively from current directory
find ./ -name "Thumbs.db" -exec rm '{}' \;
# Restore default permissions
chmod 755 $(find ./ -type d) && chmod 644 $(find ./ -type f)