start new:
tmux
start new with session name:
tmux new -s myname
<!-- Add the following lines to theme's html code right before </head> --> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> | |
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script> | |
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script> | |
<!-- | |
Usage: just add <div class="gist">[gist URL]</div> | |
Example: <div class="gist">https://gist.github.com/1395926</div> | |
--> |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
sudo kill `ps -ax | grep 'coreaudiod' | grep 'sbin' |awk '{print $1}'` | |
# or... | |
sudo killall coreaudiod |
# Show message box popup. | |
Add-Type -AssemblyName System.Windows.Forms | |
$result = [System.Windows.Forms.MessageBox]::Show("My message", "Window Title", [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::None) | |
# Show input box popup. | |
Add-Type -AssemblyName Microsoft.VisualBasic | |
$inputText = [Microsoft.VisualBasic.Interaction]::InputBox("Enter some value:", "Window Title", "Default value") | |
# Show an Open File Dialog and return the file selected by the user. | |
function Read-OpenFileDialog([string]$InitialDirectory, [switch]$AllowMultiSelect) |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
jQuery.fn.brightness = function() { | |
var bg_color, rgba, y; | |
bg_color = this.css('background-color'); | |
if ((bg_color != null) && bg_color.length) { | |
rgba = bg_color.match(/^rgb(?:a)?\(([0-9]{1,3}),\s([0-9]{1,3}),\s([0-9]{1,3})(?:,\s)?([0-9]{1,3})?\)$/); | |
if (rgba != null) { | |
if (rgba[4] === '0') { | |
if (this.parent().length) return this.parent().brightness(); | |
} else { | |
y = 2.99 * rgba[1] + 5.87 * rgba[2] + 1.14 * rgba[3]; |
class Plugin < ::Vagrant.plugin("2") | |
name "build" | |
action_hook('build') do |hook| | |
hook.after(Vagrant::Action::Builtin::Provision, 2) do | |
system("bash build.sh") | |
end | |
end | |
end |
function sync(gen) { | |
var iterable, resume, check, vals, ops; | |
vals = []; | |
ops = 0; | |
check = function() { | |
if (vals.length == ops) { | |
if (ops == 1) { | |
iterable.next(vals[0]); |