Skip to content

Instantly share code, notes, and snippets.

View pbarnes's full-sized avatar
🎯
Focusing

Phil pbarnes

🎯
Focusing
  • Atlanta, Georgia
View GitHub Profile
@briancavalier
briancavalier / internal-queue.js
Last active December 27, 2015 18:29
"Promisify" a business object using an internal queue to serialize async operations
var when = require('when');
var delay = require('when/delay');
var slice = Array.prototype.slice;
var promisePrototype = Object.getPrototypeOf(when.resolve());
//---------------------------------------------------------
// A simple business object
//---------------------------------------------------------
function MyObj() {
this._queue = when.resolve();
@brendanhay
brendanhay / tmux-copy-mode-osx.md
Created February 8, 2012 14:15
Tmux, copy-mode, and OSX shenanigans.

Copy, with line wrapping!

If you've been trying to copy/paste text from a multi-pane tmux session with the mouse, you've probably been pretty pissed at the blissful ignorance a terminal application has of the rodent in your hand.

The alternative, which is quote-unqoute native copy/pasting using copy-mode takes a bit to get used to. So this is one solution for copying and pasting lines from a session with correct line wrapping behaviour, albeit keyboard only.

Disclaimer

Since copy-mode has similar concepts of marks, regions, and temp buffers to Emacs .. you'll probably find it straight forward if you're familar with Emacsen. For people using vi-mode in tmux, the same still applies but obviously the default key bindings will differ alot from what I show below.