(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
; AutoHotkey script, download from: | |
; http://www.autohotkey.com/ | |
; NOTE: Save this file with Windows line endings i.e. \r\n | |
; | |
cmd_line := "C:\bin\cygwin\bin\mintty.exe /bin/zsh --login" | |
wnd_class := "ahk_class mintty" | |
#c:: |
//author: lo sauer 2011 | |
//given for instance, is a text with placeholders of which only the value is to be captured | |
//JS's 'match' ignores the non-capture group (?:...), for instance in a global search | |
str = "Hello I am {{name}}. Is it already the {{date}}"; | |
str.match(/(?:\{{2})([a-z0-9]*)(?:\}{2})/i); | |
>>>["{{name}}", "name"] | |
str.match(/(?:\{{2})([a-z0-9]*)(?:\}{2})/gi); | |
>>>["{{name}}", "{{date}}"] |
/** | |
* `url` can be a data URI like data: or a blob URI like blob: or an existing, public resource like http: | |
* `filename` is the (default) name the file will be downloaded as | |
*/ | |
function download( url, filename ) { | |
var link = document.createElement('a'); | |
link.setAttribute('href',url); | |
link.setAttribute('download',filename); | |
var event = document.createEvent('MouseEvents'); | |
event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null); |
Arg Name or Optional Flags: | |
positional : str = "foo" | |
options : str = "-f", "--foo" | |
Standard: | |
action : str = [store], append, store_true, store_false, store_const, append_const, version | |
default : * = [None] | |
type : callable = [str], argparse.FileType(mode='wb', bufsize=0) | |
Exotic: |
function hang(n) { | |
var x = new XMLHttpRequest(); | |
x.open('GET', 'http://hang.nodester.com/script.js?' + n, false); | |
x.send(); | |
} | |
// usage: hang(2 * 1000); |
#!/bin/bash | |
# Put me in /usr/local/bin/killgrep | |
ps aux | egrep $1 | egrep -v '(killgrep)|(egrep)' | awk '{print $2}' | xargs kill -9 |
# Create background noise profile from mp3 | |
/usr/bin/sox noise.mp3 -n noiseprof noise.prof | |
# Remove noise from mp3 using profile | |
/usr/bin/sox input.mp3 output.mp3 noisered noise.prof 0.21 | |
# Remove silence from mp3 | |
/usr/bin/sox input.mp3 output.mp3 silence -l 1 0.3 5% -1 2.0 5% | |
# Remove noise and silence in a single command |
#NoEnv | |
/* | |
SimplePing | |
========== | |
AHK library providing a variety of ICMP pinging-related functionality. | |
Examples | |
-------- |
# This hosts file is brought to you by Dan Pollock and can be found at | |
# http://someonewhocares.org/hosts/ | |
# You are free to copy and distribute this file for non-commercial uses, | |
# as long the original URL and attribution is included. | |
#<localhost> | |
127.0.0.1 localhost | |
127.0.0.1 localhost.localdomain | |
255.255.255.255 broadcasthost | |
::1 localhost |