start new:
tmux
start new with session name:
tmux new -s myname
| # 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 |
| class FullPaths(argparse.Action): | |
| """Expand user- and relative-paths""" | |
| def __call__(self, parser, namespace, values, option_string=None): | |
| setattr(namespace, self.dest, os.path.abspath(os.path.expanduser(values))) | |
| def is_dir(dirname): | |
| """Checks if a path is an actual directory""" | |
| if not os.path.isdir(dirname): | |
| msg = "{0} is not a directory".format(dirname) | |
| raise argparse.ArgumentTypeError(msg) |
| ಠ_ಠ | |
| ( ͡° ͜ʖ ͡°) | |
| ¯\_(ツ)_/¯ | |
| (╯°□°)╯︵ ┻━┻ | |
| http://www.fileformat.info/convert/text/upside-down.htm | |
| WRTTN http://wrttn.me/30dbfd/ | |
| Unicode Emoticons |
| # Install Bash 4 using homebrew | |
| brew install bash | |
| # Or build it from source... | |
| curl -O http://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz | |
| tar xzf bash-4.2.tar.gz | |
| cd bash-4.2 | |
| ./configure --prefix=/usr/local/bin && make && sudo make install | |
| # Add the new shell to the list of legit shells |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| # Enter your code here. Read input from STDIN. Print output to STDOUT | |
| class Node: | |
| def __init__(self,value,point): | |
| self.value = value | |
| self.point = point | |
| self.parent = None | |
| self.H = 0 | |
| self.G = 0 | |
| def move_cost(self,other): | |
| return 0 if self.value == '.' else 1 |
| /** | |
| * An array forEach with a delay between steps. | |
| * | |
| * @param {Function} callback Function to execute for each element. It receives three arguments, the element value, the element index and the array being traversed, respectivily. | |
| * @param {Number} timeout Number of milliseconds that the function call should be delayed by. | |
| * @param {Object} thisArg Object to use as this when executing callback. | |
| * @this {Array} | |
| * @return {undefined} | |
| */ | |
| Array.prototype.delayedForEach = function(callback, timeout, thisArg){ |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!