Skip to content

Instantly share code, notes, and snippets.

View mingliangguo's full-sized avatar

Mingliang mingliangguo

View GitHub Profile
@mingliangguo
mingliangguo / .bash_profile
Created June 21, 2011 10:45 — forked from wimleers/.bash_profile
My bash prompt. Inelegant code, yet elegant result.
# Colorizing. Source: http://systhread.net/texts/200703bashish.php.
DULL=0
BRIGHT=1
FG_BLACK=30
FG_RED=31
FG_GREEN=32
FG_YELLOW=33
FG_BLUE=34
@mingliangguo
mingliangguo / .bash_profile
Created June 22, 2011 02:47 — forked from wimleers/.bash_profile
My bash prompt. Inelegant code, yet elegant result.
# Colorizing. Source: http://systhread.net/texts/200703bashish.php.
DULL=0
BRIGHT=1
FG_BLACK=30
FG_RED=31
FG_GREEN=32
FG_YELLOW=33
FG_BLUE=34
@mingliangguo
mingliangguo / apiexamples.js
Created July 26, 2012 10:22 — forked from jrburke/apiexamples.js
Description of browser-friendly module APIs: AMD and Loader Plugins
//*******************************************
// Level 1, basic API, minimum support
//*******************************************
/*
Modules IDs are strings that follow CommonJS
module names.
*/
//To load code at the top level JS file,
//or inside a module to dynamically fetch
@mingliangguo
mingliangguo / gist:3291698
Created August 8, 2012 03:06 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@mingliangguo
mingliangguo / keyrepeat.shell
Last active October 24, 2016 14:38 — forked from kconragan/keyrepeat.shell
keyrepeat.shell
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text 2 if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@mingliangguo
mingliangguo / Sublime Text 2 - Useful Shortcuts (Mac OS X)
Last active October 24, 2016 14:37 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts (Mac OS X)
h1. Sublime Text 2 - Useful Shortcuts (Mac OS X)
h2. General
| *⌘T* | go to file |
| *⌘⌃P* | go to project |
| *⌘R* | go to methods |
| *⌃G* | go to line |
| *⌘KB* | toggle side bar |
| *⌘⇧P* | command prompt |
@mingliangguo
mingliangguo / git_branch_parent.sh
Last active October 20, 2016 00:33 — forked from intel352/git_branch_parent.sh
get the parent of the current branch
#!/usr/bin/env zsh
branch=`git rev-parse --abbrev-ref HEAD`
git show-branch | ack '\*' | ack -v "$branch" | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//'
# How it works:
# 1| Display a textual history of all commits.
# 2| Ancestors of the current commit are indicated
# by a star. Filter out everything else.
@mingliangguo
mingliangguo / 0_reuse_code.js
Created October 18, 2016 13:53
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mingliangguo
mingliangguo / tmux.conf
Created November 23, 2016 17:47 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@mingliangguo
mingliangguo / osx-setup.md
Created December 26, 2016 03:44 — forked from zenorocha/.hyper.js
Setup macOS Sierra (10.12)

Setup macOS

I'm in a hospital in Spain and my MacBook was stolen.

Hospital Commit

Now I bought a new one and need to configure it. I have an AirPort Time Capsule that backs up everything using Time Machine, but I don't want all the crap I had in the old one. So let's get our hands dirty!

1. Update OS to latest version