Skip to content

Instantly share code, notes, and snippets.

@Lanny
Lanny / everforest.py
Created May 8, 2023 18:53
Everforest theme for qutebrowser
def get_pallet(scheme = 'dark', intensity = 'hard'):
if scheme not in ('dark', 'light'):
raise RuntimeError('Schme must be one of "dark", "light".')
if intensity not in ('hard', 'medium', 'soft'):
raise RuntimeError('Intensity must be one of "hard", "medium", "soft".')
pallet = None
if scheme == 'dark':
pallet = {
'fg': '#d3c6aa',
@Lanny
Lanny / README.md
Created June 28, 2021 16:41
File Hierarchy Preview

Outputs a limited file tree rooted at the current directory which highlights the position of the argument within the tree. Originally intended for FZF like so:

fzf --preview 'ptf.py {}'

Screenshot:

screenshot

@Lanny
Lanny / state-tax.json
Last active March 3, 2021 22:34
US state income tax data
{
"_META": {
"year": 2001,
"source": "https://files.taxfoundation.org/20210217114725/State-Individual-Income-Tax-Rates-and-Brackets-for-2021.pdf",
"updates_and_fixes": "https://gist.github.com/Lanny/cfb412dba213b59c7c74d7b940e77e3f",
"description": "Extraction of taxfoundation.org's info on 2021 US state income taxes into JSON for automatic processing. Tax brackets are expressed as 2-tuples of incomeat the bottom of the bracket, and tax rate within that bracket (as apercentage)."
},
"DATA": {
"AL": {
"BRACKETS": {
@Lanny
Lanny / mr.py
Last active March 4, 2018 03:24
import urllib2
import time
from collections import defaultdict
def run_mr(mapf, reducef, data):
intr = defaultdict(list)
final = []
def emitIntr(key, value):
intr[key].append(value)
@Lanny
Lanny / MethodSplitView.py
Created July 29, 2017 23:06
flexible class for splitting handling of different HTTP methods being dispatched to the same view into separate class methods
class MethodSplitView(object):
"""
A flexible class for splitting handling of different HTTP methods being
dispatched to the same view into seperate class methods. Subclasses may
define a separate class method for each HTTP method the view handles (e.g.
GET(self, request, ...), POST(self, request, ...) which will be called with
the usual view signature when that sort of reqeust is made.
Subclasses may also define a `pre_method_check` method which, if it returns
a HttpResponse, will be used to response to the request instead of
@Lanny
Lanny / irvine.py
Last active August 29, 2015 14:28
like ctrl-p but for the terminal I guess?
#!/usr/bin/env python
import os
import sys
import subprocess
from fnmatch import fnmatch
from multiprocessing import Process, Queue
from Queue import Empty as QEmpty
@Lanny
Lanny / fine.sh
Created August 18, 2015 17:31
A utility to view the output of find in vim's fs explorer
#!/usr/bin/env bash
targ_dir=`mktemp -d /tmp/fine_dir.XXXX`
find . -name "*$@*" | while read line; do
ln -s "$(pwd)/$line" "$targ_dir"
done
mvim "$targ_dir"
int MARGIN = 30,
HEAD_SIZE = 200, // Jenkins, you bigheaded bastard
DRUM_ROWS = 3,
DRUM_COLS = 3,
SPACING = 10;
ArrayList<DrumHead> drums = new ArrayList<DrumHead>();
ArrayList<PressArea> pressAreas = new ArrayList<PressArea>();
class PressArea {
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BackgroundBlur</key>
<real>0.0</real>
<key>BackgroundColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGISJYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKUHCBMXHlUkbnVsbNUJCgsMDQ4PEBESVk5TQ01ZS1xOU0NvbXBvbmVudHNcTlND
@Lanny
Lanny / .zshrc
Created September 11, 2014 00:23
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="mh"
# Uncomment the following line to use case-sensitive completion.