- Oil (olive, neutral, schmaltz, whatever)
- 1/2lb, plus or minus 1/2lb Andouije or kielbasa sausage, cubed up into 1cm pieces
- korean chives: 3 cups diced. Substitute a shitload of scallions.
- bacon: 1/2 pound diced
- Couple slices smoked turkey (optional), diced
- kimchi, 1 cup, diced
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function testshit { | |
local testname="${1:?Test name needs to be first parameter bro}" | |
local url="${2:?URL needs to be second parameter bro}" | |
local regex="${3:?Regex needs to be third parameter bro}" | |
# Can do this multiple times if you want with different CURL args to e.g. test the headers/response code/body: | |
local curlout=$(curl -whatever "$url") | |
if echo "$curlout" | grep -P "$regex" >/dev/null; then | |
echo "$testname ($url): all good" | |
else | |
echo -e "$testname ($url): failed\nexpected to match: $regex\nInstead, got output:$curlout" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Optimized potential-anagram identifier function. | |
Runs in O(N) time on the supplied string, with several o(N) optimizations as well. | |
Consumes at worst half of the supplied string's space in memory (additionally), plus overhead. | |
This algorithm uses two paths: a reusable array of integer values (it could just as well be a bitfield, | |
but that probably won't save any performance since memory has to be written in whole words anyway) | |
with a known, fixed size: it will store the first, most common, 512 characters of the alphabet and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
wrap() { | |
local old_name="${1:?get fuct}" | |
local new_name="${2:?get fuct}" | |
_temp_function() { | |
echo "wrapping the old one!" | |
_old_function_call_placeholder param |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo(object): | |
def __init__(s, foo): | |
s.wrapped = foo | |
def __getattr__(s, attr): | |
target = attr | |
if attr.startswith('__') and not attr.endswith('__'): | |
target = '_{}{}'.format(s.wrapped.__class__.__name__, attr) | |
return getattr(s.wrapped, target) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import os.path | |
import sys | |
from collections import namedtuple, defaultdict | |
ResultSpec = namedtuple('ResultSpec', ('subdir', 'file_filter', 'join')) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Are you tired of Python being slow? Wish it was faster in irrelevant ways at the cost of being massively slower | |
and more fragile in every relevant way? Tired of how costly it is to look up attributes on classes? Wish you could | |
"stop" a class when you're done with it, and cause all future interactions with it to raise baffling exceptions? Do | |
you hate that attribute assignment is a statement? Then you might like this alternative* object system I wrote! | |
Don't have any of those problems? Well, that's fine, because nobody asked for this anyway. | |
It has: | |
- Access without dots. Dots are so .... Java. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Bkt < Formula | |
desc "Utility for caching the resilts of shell commands" | |
homepage "https://www.bkt.rs" | |
url "https://crates.io/api/v1/crates/bkt" | |
sha256 "e6acab9ae6a617fe471dceed9f69064e1f0cb3a8eb93d82e2087faeab4d48ee8" | |
license "MIT" | |
depends_on "rust" => :build | |
uses_from_macos "zlib" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -xuo pipefail | |
brew cleanup | |
brew cleanup --prune=all | |
rm -rf "$(brew --cache)" | |
pip cache purge | |
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder | |
sudo rm -rf "/Users/$USER/Library/Caches/Sublime Text/Cache/__pycache__" | |
find ~ -type d -name "__pycache__" -exec rm -rv {} \; |
OlderNewer