Skip to content

Instantly share code, notes, and snippets.

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

Fred Chu fredchu

🏠
Working from home
View GitHub Profile
@fredchu
fredchu / Git Checkout to A Remote Branch
Created February 3, 2015 02:20
Git Checkout to A Remote Branch
git checkout -t origin/branch-name
git reset HEAD file_path
@fredchu
fredchu / git-log-graph
Created December 29, 2014 03:31
show git log with graph in terminal
git log --graph --oneline
@fredchu
fredchu / git-tip-show-commits-about-a-file
Created December 29, 2014 03:30
git show commits about a file
git log -p filepath
@fredchu
fredchu / preference.json
Last active August 29, 2015 14:07
Preference for Sublime Text 3
{
"close_windows_when_empty": true,
"color_scheme": "Packages/Theme - Spacegray/base16-ocean.dark.tmTheme",
"disable_formatted_linebreak": true,
"draw_white_space": false,
"file_exclude_patterns":
[
"*.sassc",
"*.scssc",
"*.log",
@fredchu
fredchu / .bash_profile
Last active August 29, 2015 14:07
My .bash_profile
export PATH=$PATH:~/bin
export EDITOR='subl -w'
export CLICOLOR=1
alias sl="subl"
alias ll="ls -al"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
function git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return;
@fredchu
fredchu / basehosts
Created October 8, 2014 15:16
DNS Proxy for browsing china sites
192.241.222.103 v.youku.com
192.241.222.103 api.youku.com
192.241.222.103 v2.tudou.com
192.241.222.103 www.tudou.com
192.241.222.103 s.plcloud.music.qq.com
192.241.222.103 hot.vrs.sohu.com
192.241.222.103 live.tv.sohu.com
192.241.222.103 pad.tv.sohu.com
192.241.222.103 my.tv.sohu.com
192.241.222.103 hot.vrs.letv.com
@fredchu
fredchu / disable-scrolling.css
Created August 15, 2014 07:39
Disable scrolling with CSS
body {
overflow: hidden;
}
@fredchu
fredchu / link-to-google-map-with-address-specified.html
Created July 28, 2014 05:33
Link for redirecting to Google Map with address specified
@fredchu
fredchu / style-placeholder-text.css
Created July 17, 2014 03:20
Style Placeholder Text
::-webkit-input-placeholder {
color: red;
}
:-moz-placeholder { /* Firefox 18- */
color: red;
}
::-moz-placeholder { /* Firefox 19+ */
color: red;