Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile
Birch-san /
Created May 30, 2018 — forked from pjv/
get latest version of installed ungoogled chromium extensions
#!/usr/bin/env bash
# dependencies:
# curl
# Ascertain directory in which script lives; compatible with all UNIX
# Thanks to kenorb
Birch-san / gist:7f3c8d4fe5cf3feea704b170e8b16298
Created Apr 16, 2018
Blocked on mutex inside AudioObjectGetPropertyDataSize (CoreAudio.framework, AudioHardware.h)
View gist:7f3c8d4fe5cf3feea704b170e8b16298
__psynch_mutexwait 0x00007fff55a07d1e
_pthread_mutex_lock_wait 0x00007fff55b43bfe
_pthread_mutex_lock_slow 0x00007fff55b41551
HALB_Mutex::Lock() 0x00007fff2da9c91f
HALC_ProxyIOContext::GetPropertyDataSize(AudioObjectPropertyAddress const&, unsigned int, void const*, unsigned int&) const 0x00007fff2dab9fe1
HALC_ShellObject::GetPropertyDataSize(unsigned int, AudioObjectPropertyAddress const&, unsigned int, void const*, unsigned int&) const 0x00007fff2dacecc8
HAL_HardwarePlugIn_ObjectGetPropertyDataSize(AudioHardwarePlugInInterface**, unsigned int, AudioObjectPropertyAddress const*, unsigned int, void const*, unsigned int*) 0x00007fff2dace4bf
HALPlugIn::ObjectGetPropertyDataSize(HALObject const&, AudioObjectPropertyAddress const&, unsigned int, void const*) const 0x00007fff2dace22c
AudioObjectGetPropertyDataSize 0x00007fff2dac9fb1
get_num_outputs 0x000000011c065584
Birch-san / httpd.conf
Created Jun 28, 2017
Default `/etc/apache2/httpd.conf` provided with Alpine Apache (`apk add apache2`)
View httpd.conf
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:> for detailed information.
# In particular, see
# <URL:>
# for a discussion of each configuration directive.
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
Birch-san / stat_2_Sierra.txt
Created Apr 3, 2017
Mac OS Sierra 10.12 man page for `stat(2)`
View stat_2_Sierra.txt
STAT(2) BSD System Calls Manual STAT(2)
fstat, fstat64, lstat, lstat64, stat, stat64, fstatat -- get file status
#include <sys/stat.h>
fstat(int fildes, struct stat *buf);
Birch-san / Iterative compound interest calculator.js
Created Feb 26, 2016
Compound interest where interest is calculated daily, but credited monthly.
View Iterative compound interest calculator.js
var finalAmount = (function() {
var initialPounds = 40000;
var denominationOfYearUponWhichInterestCalculated = 365;
var denominationsAfterWhichInterestCredited = Math.floor(denominationOfYearUponWhichInterestCalculated/12);
var annnualInterestCoefficient = 1.05;
var denominationInterestCoefficient = Math.pow(annnualInterestCoefficient, 1/denominationOfYearUponWhichInterestCalculated);
var yearsSimulated = 5;
var amountSpentPerMonth = 500;
var amountSpentPerYear = amountSpentPerMonth*12;
var amountSpentPerDenomination = amountSpentPerYear/denominationOfYearUponWhichInterestCalculated;
Birch-san / .zshrc
Last active Aug 29, 2015
My customizations to .zshrc
View .zshrc
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git sublime jsontools zsh-syntax-highlighting)
Birch-san / .vimrc
Created Aug 18, 2015
Awesome vim syntax highlighting
View .vimrc
"The following three lines map Ctrl+s to save in vi. You can comment
"these out, it has nothing to do with syntax highlighting or colors.
" optional lines to turn on pressing F2 to toggle paste mode
noremap <F2> :set invpaste paste?<CR>i
set pastetoggle=<F2>
:nmap <c-s> :w<CR>
:imap <c-s> <Esc>:w<CR>a
View Default (OSX).sublime-keymap
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+pagedown"], "command": "next_view" },
{ "keys": ["super+pagedown"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" },
{ "keys": ["ctrl+pageup"], "command": "prev_view" },
{ "keys": ["super+pageup"], "command": "prev_view" },
{ "keys": ["ctrl+1"], "command": "reveal_in_side_bar"},
{ "keys": ["ctrl+w"], "caption": "Selection: Expand to Brackets", "command": "expand_selection", "args": {"to": "brackets"}},
{ "keys": ["alt+up"], "caption": "Edit: Swap Line Up", "command": "swap_line_up" },
View Compound Interest Calculator.js
return "£"+(function compound(balanceAtYearBeginning, amountDepositedPerYear, coeff, pow, interestOnly, initialAmount) {
return pow // are we on base case or inductive case?
? compound(
(balanceAtYearBeginning + amountDepositedPerYear) * coeff, // apply year's interest to starting balance plus deposit
initialAmount || balanceAtYearBeginning
Birch-san / delete duplicate entries from Google Play Music user
Created Feb 15, 2015
Delete duplicate entries from Google Play Music user playlist
View delete duplicate entries from Google Play Music user
from gmusicapi import Mobileclient
# Get gmusicapi:
# This script iterates through all your playlists, and deletes any playlist entries that
# have a duplicate later on in the same playlist.
api = Mobileclient()
logged_in = api.login('', 'nice try :P')
playlists = api.get_all_user_playlist_contents()
You can’t perform that action at this time.