As configured in my dotfiles.
start new:
tmux
start new with session name:
| [Unit] | |
| Description=Errbit Unicorn Server | |
| Requires=mongodb.service | |
| After=mongodb.service network.target | |
| [Service] | |
| # Change here: user, group and directory to errbit root | |
| User=errbit | |
| Group=errbit | |
| WorkingDirectory=/var/www/apps/errbit |
| #!/bin/sh | |
| # Convenience functions to set the tmux session name based on branches/pull | |
| # numbers and switches branches based on the session name. | |
| # | |
| # Depends on tmux and https://github.com/iFixit/git-scripts. | |
| # (feature|hotfix) switch based on the session name. | |
| function tswitch { | |
| BRANCH=$(tmux display-message -p '#S' | sed 's/|.*$//') |
| # download latest libevent2 and tmux sources, and extract them somewhere | |
| # (thx bluejedi for tip on latest tmux URL) | |
| # | |
| # at the time of writing: | |
| # https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | |
| # http://sourceforge.net/projects/tmux/files/latest/download?source=files | |
| # | |
| # install deps | |
| yum install gcc kernel-devel make ncurses-devel |
| nnoremap <silent> <C-o> :call FindFile()<CR> | |
| function! FindFile() | |
| " Get the word under cursor. | |
| let cursorWord = expand("<cword>") | |
| " Get the current file name and keep only the extension. | |
| let currentFile = expand("%") | |
| let extPos = stridx(currentFile, ".") | |
| " Append an extension only if the current file has an extension. |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| var mongoose = require('mongoose'); | |
| var db = mongoose.connect("mongodb://localhost/testdb"); | |
| var reconnTimer = null; | |
| function tryReconnect() { | |
| reconnTimer = null; | |
| console.log("try to connect: %d", mongoose.connection.readyState); | |
| db = mongoose.connect("mongodb://localhost/testdb"); | |
| } |
| var client = new xmpp.Client({ | |
| jid: '[email protected]', // where 123456 is the users facebook id | |
| api_key: apiKey, // api key of your facebook app | |
| secret_key: secretKey, // secret key of your facebook app | |
| session_key: sessionKey // users current session key | |
| }); | |
| // you can find more details here http://developers.facebook.com/docs/chat/ |
| /* | |
| Right here's the thing - for keyPress events to be run, you'll have to make use of | |
| content scripts. Content scripts handle things at webpage & DOM level. You'll have | |
| to do changes to your manifest: | |
| */ | |
| ------------------------ | |
| manifest.json: | |
| ------------------------ | |
| /* | |
| Note: don't replace manifest.json, add the relevant changes else |
| if (window.XDomainRequest) (function(){ | |
| var onLoad = function(){ | |
| cleanup(this.xhr); | |
| this.response = {text: this.xhr.responseText, xml: this.xhr.responseXML}; | |
| this.success(this.response.text, this.response.xml); | |
| }; | |
| var onError = function(){ | |
| cleanup(this.xhr); |