start new:
tmux
start new with session name:
tmux new -s myname
| <?php | |
| #source: http://stackoverflow.com/questions/2934563/how-to-decode-unicode-escape-sequences-like-u00ed-to-proper-utf-8-encoded-char | |
| function replace_unicode_escape_sequence($match) { | |
| return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); | |
| } | |
| function unicode_decode($str) { | |
| return preg_replace_callback('/\\\\u([0-9a-f]{4})/i', 'replace_unicode_escape_sequence', $str); | |
| } |
| " tmux will only forward escape sequences to the terminal if surrounded by a DCS sequence | |
| " http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTinkbdoZ8eNR1X2UobLTeww1jFrvfJxTMfKSq-L%2B%40mail.gmail.com&forum_name=tmux-users | |
| if exists('$TMUX') | |
| let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\" | |
| let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\" | |
| else | |
| let &t_SI = "\<Esc>]50;CursorShape=1\x7" | |
| let &t_EI = "\<Esc>]50;CursorShape=0\x7" | |
| endif |
| #!/bin/sh | |
| # Simple init script to dig a ssh tunnel | |
| # Author: Christoph Heer <[email protected]> | |
| SSH_ARGS="[email protected] -p 22 -N -n -L 4950:localhost:4949" | |
| PID_FILE="/var/run/remote_host_tunnel.pid" | |
| case "$1" in | |
| start) | |
| if [ -f $PID_FILE ]; then |
| $ redis-cli | |
| > config set stop-writes-on-bgsave-error no |
A slightly updated version of this doc is here on my website.
I visited with PagerDuty yesterday for a little Friday beer and pizza. While there I got started talking about Go. I was asked by Alex, their CEO, why I liked it. Several other people have asked me the same question recently, so I figured it was worth posting.
The first 1/2 of Go's concurrency story. Lightweight, concurrent function execution. You can spawn tons of these if needed and the Go runtime multiplexes them onto the configured number of CPUs/Threads as needed. They start with a super small stack that can grow (and shrink) via dynamic allocation (and freeing). They are as simple as go f(x), where f() is a function.
| location ~ /\.git { | |
| deny all; | |
| } | |
| # or, all . directories/files in general (including .htaccess, etc) | |
| location ~ /\. { | |
| deny all; | |
| } |
| <?php | |
| /** | |
| * Case-insensitive in_array() wrapper. | |
| * | |
| * @param mixed $needle Value to seek. | |
| * @param array $haystack Array to seek in. | |
| * | |
| * @return bool | |
| */ |
WARNING: If you're reading this in 2021 or later, you're likely better served by reading:
(This gist was created in 2013 and targeted the legacy GOPATH mode.)
$ ssh -A vm
$ git config --global url."[email protected]:".insteadOf "https://github.com/"⌘ – ⌘ – ⌘ – the Command Key symbol
⌥ – ⌥ – ⌥ – the Option Key symbol
⇧ – ⇧ – ⇧ – the Shift Key symbol
⌃ – ⌃ – ⌃ – the Control Key symbol
⎋ – ⎋ – ⎋ – the ESC Key symbol
⇪ – ⇪ – ⇪ – the Capslock symbol
⏎ – ⏎ – ⏎ – the Return symbol
⌫ – ⌫ – ⌫ – the Delete / Backspace symbol
⇥ – ⇥ – ⇥ – the Tab Key symbol