start new:
tmux
start new with session name:
tmux new -s myname
| const fs = require('fs'), | |
| util = require('util'), | |
| file = fs.createWriteStream(__dirname + '/error.log', {flags : 'w'}), | |
| sout = process.stdout, | |
| err = d => { | |
| file.write(util.format(d) + '\n') | |
| sout.write(util.format(d) + '\n') | |
| } |
| console.log(9999999999999999); // 10000000000000000 | |
| [] + {} // '[object Object]' | |
| {} + [] // 0 | |
| console.log(!+[]+[]+![] === 'truefalse'); // true | |
| Math.max( ...[] ) // -Infinity | |
| Math.max( undefined ) // NaN | |
| console.log( …[] ) // undefined |
| #!/usr/bin/osascript | |
| # | |
| # now_playing.osascript | |
| # | |
| # Osascript to fetch the meta data of the currently playing | |
| # track in Spotify. This works only on Mac OS X. | |
| tell application "System Events" | |
| set myList to (name of every process) | |
| end tell |
| @namespace html url(http://www.w3.org/1999/xhtml); | |
| @namespace xul url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul); | |
| /* | |
| Author: Twily | |
| Description: Minimal flat styled tabs for Australis | |
| Compitability: Firefox Nightly v31.0a1 - v32.0a1 (Australis) | |
| CSS Variables were introduced to Firefox in v29.0a1 | |
| Website: http://twily.info/ | |
| */ |
| # .tmux.conf.local | |
| ==== | |
| set -g default-terminal "screen-256color" | |
| set-option -g status-position bottom | |
| set-window-option -g xterm-keys on | |
| bind-key -n S-Up set-option -g status | |
| bind-key -n S-Down set-option -g status | |
| bind-key -n S-Left previous-window | |
| bind-key -n S-Right next-window | |
| set-option -g status-fg white |
Change the base url of a gist to cdn.rawgit.com
| let fibonacci = (n) => { | |
| if(n <= 2) { | |
| return 1; | |
| } else { | |
| return fibonacci(n - 1) + fibonacci(n - 2); | |
| } | |
| }; |
| let arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], | |
| avgs = [], | |
| sum = 0; | |
| arr.forEach((el, i) => { | |
| sum += el; | |
| if ((i + 1) % 3 == 0) { | |
| avgs.push(sum / 3); | |
| sum = 0; | |
| } |
| let state = { | |
| nestedObj: { | |
| x: 1, | |
| y: 2, | |
| }, | |
| h: 10 | |
| } | |
| let addObj = { |