Skip to content

Instantly share code, notes, and snippets.

Avatar

Birch-san

View GitHub Profile
@Birch-san
Birch-san / update_ungoogled_chromium_extensions.sh
Created May 30, 2018 — forked from pjv/update_ungoogled_chromium_extensions.sh
get latest version of installed ungoogled chromium extensions
View update_ungoogled_chromium_extensions.sh
#!/usr/bin/env bash
# dependencies:
# https://www.npmjs.com/package/chrome-web-store-item-property-cli
# https://stedolan.github.io/jq/
# curl
# Ascertain directory in which script lives; compatible with all UNIX
# Thanks to kenorb
# http://stackoverflow.com/a/17744637/5257399
@Birch-san
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
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:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# 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
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)
NAME
fstat, fstat64, lstat, lstat64, stat, stat64, fstatat -- get file status
SYNOPSIS
#include <sys/stat.h>
int
fstat(int fildes, struct stat *buf);
@Birch-san
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
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)
########
#http://superuser.com/questions/541366/way-to-move-cursor-by-arguments-in-bash
@Birch-san
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
amountDepositedPerYear,
coeff,
pow-1,
interestOnly,
initialAmount || balanceAtYearBeginning
)
@Birch-san
Birch-san / delete duplicate entries from Google Play Music user playlist.py
Created Feb 15, 2015
Delete duplicate entries from Google Play Music user playlist
View delete duplicate entries from Google Play Music user playlist.py
from gmusicapi import Mobileclient
# Get gmusicapi: https://github.com/simon-weber/Unofficial-Google-Music-API
# 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('email@sharklasers.com', 'nice try :P')
playlists = api.get_all_user_playlist_contents()
You can’t perform that action at this time.