start new:
tmux
start new with session name:
tmux new -s myname
#!/usr/local/bin/ruby | |
####################################################### | |
# | |
# Ruby interactive input/eval loop | |
# Written by matz (matz@netlab.co.jp) | |
# Modified by Mark Slagell (slagell@ruby-lang.org) | |
# with suggestions for improvement from Dave Thomas | |
# (Dave@Thomases.com) | |
# |
st = "\033[7m" | |
en = "\033[m" | |
while TRUE | |
print "str> " | |
STDOUT.flush | |
str = gets | |
break | |
if not str | |
str.chop! | |
print "pat> " |
Go to the end of the line: ctrl+e | |
Go to the beginning of the line: ctrl+a | |
Move by one letters at a time: ctrl+f (ctrl+b to go backwards) | |
Move by word alt+f (alt+b to go backwards) | |
Delete words: alt+d (remember that you need to be in the beginning of the word) |
heroku keys:add ~/.ssh/id_rsa.pub |
local usbWatcher = nil | |
function usbDeviceCallback(data) | |
if (data["productName"] == "USB Keyboard") then | |
if (data["eventType"] == "added") then | |
hs.execute('/Applications/Karabiner.app/Contents/Library/bin/karabiner select 1') | |
elseif (data["eventType"] == "removed") then | |
hs.execute('/Applications/Karabiner.app/Contents/Library/bin/karabiner select 0') | |
end | |
end |
var yourTag=document.createElement('meta'); | |
window.getSelection ? yourTag.name='name' : yourTag.Name='name' | |
yourTag.content='content'; | |
document.getElementsByTagName('head')[0].appendChild(yourTag); |
onbeforeunload = function(e){ | |
if(confirm('Are you nuts? Do you really want to leave me?')){ | |
return 'OK, Good Bye then'; | |
} | |
else { | |
e = e || event; | |
if(e.preventDefault){e.preventDefault();} | |
e.returnValue = false; | |
return 'I said, "Are you nuts? Do you really want to leave me?"'; | |
} |
var sys = require('sys') var exec = require('child_process').exec; function puts(error, stdout, stderr) { sys.puts(stdout) } function run () { console.log("Le quita a los ricos"); exec("mongodump --host 127.0.0.1 --port 27017 --db namedb --username username --password strongpass --out /mongodump", puts); setTimeout(function () { postinmongo(); }, 10000); } function postinmongo() { console.log("Le da a los pobres"); exec("mongorestore mongodump"); setTimeout(function () { run(); }, 3000); } run(); |
// UTF8 Module | |
// | |
// Cleaner and modularized utf-8 encoding and decoding library for javascript. | |
// | |
// copyright: MIT | |
// author: Nijiko Yonskai, @nijikokun, nijikokun@gmail.com | |
(function (name, definition, context, dependencies) { | |
if (typeof context['module'] !== 'undefined' && context['module']['exports']) { if (dependencies && context['require']) { for (var i = 0; i < dependencies.length; i++) context[dependencies[i]] = context['require'](dependencies[i]); } context['module']['exports'] = definition.apply(context); } | |
else if (typeof context['define'] !== 'undefined' && context['define'] === 'function' && context['define']['amd']) { define(name, (dependencies || []), definition); } | |
else { context[name] = definition.apply(context); } |