Skip to content

Instantly share code, notes, and snippets.

nofxx / errbit-unicorn.service
Created Jan 5, 2015
errbit unicorn systemd service
View errbit-unicorn.service
Description=Errbit Unicorn Server
# Change here: user, group and directory to errbit root
marczych / gist:10524654
Last active Aug 29, 2015
Tmux git-scripts functions
View gist:10524654
# 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
# (feature|hotfix) switch based on the session name.
function tswitch {
BRANCH=$(tmux display-message -p '#S' | sed 's/|.*$//')
sturadnidge / tmux-1.8-on-CentOS-6.x.txt
Last active Jun 20, 2019
Install tmux 1.8 on CentOS 6.x minimal (64bit)
View tmux-1.8-on-CentOS-6.x.txt
# download latest libevent2 and tmux sources, and extract them somewhere
# (thx bluejedi for tip on latest tmux URL)
# at the time of writing:
# install deps
yum install gcc kernel-devel make ncurses-devel
marczych / gist:3882918
Created Oct 13, 2012
Vim: Take the word under the cursor, append the current buffer's extension, and open it using find.
View gist:3882918
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.
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:


start new with session name:

taf2 / reconnect-on-disconnect.js
Created Jul 1, 2011
mongoose node.js reconnect code
View reconnect-on-disconnect.js
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");
naltatis / facebook-xmpp.js
Created May 9, 2011
connecting to Facebook via node-xmpp
View facebook-xmpp.js
var client = new xmpp.Client({
jid: '', // 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
SathyaBhat / gist:894012
Created Mar 30, 2011
Chrome extensions keyboard shortcut handler
View gist:894012
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:
Note: don't replace manifest.json, add the relevant changes else
View Request.XDR.js
if (window.XDomainRequest) (function(){
var onLoad = function(){
this.response = {text: this.xhr.responseText, xml: this.xhr.responseXML};
this.success(this.response.text, this.response.xml);
var onError = function(){