Skip to content

Instantly share code, notes, and snippets.

View unbracketed's full-sized avatar

Brian Luft unbracketed

View GitHub Profile
@unbracketed
unbracketed / Repeater-FastTag-for-FastHTML.md
Last active August 3, 2024 08:13
Docs about how to make a Repeater FastTag for easily rendering lists or tables of data

Repeater FastTag

This intended as a utility component for rendering lists, iterables, or sequence-type objects, with a goal of providing useful results with minimal configuration, while allowing all aspects of rendering to be easily overridden.

Source

class Repeater:
    """
@unbracketed
unbracketed / branch-fu.md
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
unbracketed / export_repo_issues_to_csv.py
Last active August 3, 2023 18:13
Export Issues from Github repo to CSV (API v3)
"""
Exports Issues from a specified repository to a CSV file
Uses basic authentication (Github username + password) to retrieve Issues
from a repository that username has access to. Supports Github API v3.
"""
import csv
import requests

Keybase proof

I hereby claim:

  • I am unbracketed on github.
  • I am brianluft (https://keybase.io/brianluft) on keybase.
  • I have a public key ASDA8arUp9wX5w0-kz7yGMdizo_BF-XSpQ-OtIPuddcBrQo

To claim this, I am signing this object:

@unbracketed
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
unbracketed / RC300_sync.py
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
unbracketed / gist:228457
Created November 7, 2009 01:45
Django virtualenv postactivate hook
#I usually drop something like this into my virtualenv's postactivate for some
#quick and handy shortcuts to common Django commands.
#This way dropping in to do some work on any arbitrary project is as easy as:
# 1. workon <project name>
# 2. djr
cd /path/to/site/root
#Django command shortcuts
alias dj='python manage.py'
@unbracketed
unbracketed / empty_tests_init_files.sh
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 "__init__.py" \
-exec sh -c 'echo "" > {}' \;
@unbracketed
unbracketed / README
Created October 24, 2012 14:36
The Realtime Conference 2012 - Speaker Slides
A list of slides from The Realtime Conference 2012