Skip to content

Instantly share code, notes, and snippets.

View unbracketed's full-sized avatar

Brian Luft unbracketed

View GitHub Profile

Keybase proof

I hereby claim:

  • I am unbracketed on github.
  • I am brianluft ( on keybase.
  • I have a public key ASDA8arUp9wX5w0-kz7yGMdizo_BF-XSpQ-OtIPuddcBrQo

To claim this, I am signing this object:

unbracketed /
Last active July 11, 2019 04:26
Utility for managing BOSS RC-300 memory slots and settings
import csv
import os
import shutil
import logging
log = logging.getLogger(__name__)
UPLOAD_QUEUE = "~/.rc300-queue.csv"
RC300_BASE = "/Volumes/BOSS_RC-300/ROLAND/"
unbracketed /
Created April 7, 2015 17:49
Moving commits between branches

Example: Moving up to a few commits to another branch

Branch A has commits (X,Y) that also need to be in Branch B. The cherry-pick operations should be done in the same chronological order that the commits appear in Branch A.

cherry-pick does support a range of commits, but if you have merge commits in that range, it gets really complicated

git checkout branch-B
git cherry-pick X
git cherry-pick Y
unbracketed / Matches.jsx
Last active August 29, 2015 14:17
Riff on Omniscient-style component
// content component (pure)
var Match = React.createClass({
render: () => {(
<a href="{this.props.url}">{this.props.title}</a>
unbracketed /
Created November 26, 2014 18:04
Heroku copy config
set -e
while read key value; do
echo "Setting $key=$value"
unbracketed / yyyymmdd.js
Last active August 29, 2015 14:06
Javascript date formatter YYYYMMDD
Date.prototype.yyyymmdd = function() {
var yyyy = this.getFullYear().toString();
var mm = (this.getMonth()+1).toString(); // getMonth() is zero-based
var dd = this.getDate().toString();
return yyyy + '-' + (mm[1]?mm:"0"+mm[0]) + '-' + (dd[1]?dd:"0"+dd[0]);
d = new Date();
unbracketed /
Last active December 28, 2015 11:28
Find all __init__ modules for packages named 'tests' and clear their contents
find . \
-path "*/tests/*" \
-type f \
-name "" \
-exec sh -c 'echo "" > {}' \;
unbracketed / gist:6027277
Last active February 25, 2022 09:28
Using Tmux Sessions for Managing Multiple Project / Computing Workspaces

Some fellow Tmux users I spoke with weren't using the Sessions feature, which I think is one of the coolest features of Tmux. No faulting the Tmux developers for very complete documentation, but it can take a few read-throughs for some of us before the core architecture becomes clear:

  1. The Tmux Server is a collection of Sessions.
  2. A Session is a collection of Windows.
  3. A Window is a collection of Panes which visually subdivide it in the terminal.
  4. Windows and Panes can be moved and shared between Windows, including Windows in other Sessions.

Having used a modern web browser, you already understand principles 1-3. You can open multiple browser windows (Tmux Session), each browser window has multiple tabs (Tmux Window), and each tab has a web page which probably contains multiple visual sections (Tmux Pane).

Go Get Some Popcorn

I was working on what I thought would be a not-too-dirty and not-too-premature snippet of code to cache some rendered Django templates when I realized it was going to be more complicated and in fact a little uglier than what I'd hoped. "Oh well" I thought, and decided to move on to more critical tasks. First though, to go grab some popcorn (the radioactive looking yellow stuff from Popcorn Factory in case you're wondering).

Not surprisingly, while in the kitchen it hit me that I was thinking about the problem incorrectly and that the solution was at hand. Welcome back, quick psychological win! I assume most people are aware now of the consequences of distractions on productivity. Another part of being effective is changing your context (physical surroundings, environment, etc.). I suspect many of us with technical or creative careers overlook this important aspect.

Researchers still have a lot to piece together about how the different subsystems in our brains work together, but evid

unbracketed / flotplot.ipynb
Created October 24, 2012 14:43 — forked from crbates/flotplot.ipynb
self contained flot plotting in an ipython notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.