Skip to content

Instantly share code, notes, and snippets.

Michael Lockhart sinewalker

Block or report user

Report or block sinewalker

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View bollybyte.rb
live_loop :india do
use_random_seed 4000
16.times do
sample "tabla_", choose
sleep 0.125
end
sample "tabla_", choose
sleep 0.125
2.times do
sample "tabla_", choose
@sinewalker
sinewalker / firefox-reverse-wheel.md
Last active Dec 18, 2019
Firefox Reverse/"Natural" scroll wheel direction
View firefox-reverse-wheel.md

Open about:config and set mousewheel.default.delta_multiplier_y to negative, e.g. -100 if the current value is (the default) 100

This should only be necessary on platforms where Firefox isn't honouring the global setting. For instance on a Mac or Windows it's not necessary if you've set the scrolling direction to reverse globally, but on Linux, Firefox doesn't honour KDE's setting. I haven't tested GNOME ….

The default setting is fine for an actual mouse-wheel, but when using a touchpad to two-finger-scroll (or a trackball), it's more Natural for the page to scroll down when you swipe your fingers up: it seems more like how a paper page will shift.

View irish-cream.md

Whiskey Cream

Per batch (about 870ml)

  • 1 teaspoon unsweetened cocoa powder
  • 1 teaspoon instant coffee powder
  • 1 cup (235 ml) thickened/whipping cream
  • 1 (400 ml) can sweetened condensed milk
  • ½ teaspoon vanilla extract
@sinewalker
sinewalker / bootusb-mac.md
Last active Jul 12, 2019
Make a bootable USB from an ISO image, on macOS
View bootusb-mac.md

Making a bootable USB on a Mac

  1. hdiutil convert -format UDRW -o bootimage.img sourceimage.iso
  2. diskutil list (look for the volume that's the same size as your USB device. It'll be "external".)
  3. diskutil partitionDisk /dev/diskX 1 "Free Space" "unused" "100%" (use diskX from the list!)
  4. sudo dd if=bootimage.img of=/dev/diskX bs=1m

original source

@sinewalker
sinewalker / ssh-pass.sh
Last active Jun 16, 2019
ssh-pass: add an SSH key to your agent with passphrase from password store, no clipboard
View ssh-pass.sh
#!/bin/bash
#Add specified SSH keys to the SSH Agent, using SSH_ASKPASS to retrieve
#each key's passphrase from the Unix password store (pass).
#This relies upon the keys having the same names in both your key directory
#and your password store.
if [[ -z ${1} ]]; then
echo "$(basename ${0}): no SSH key specified" 1>&2
exit 1;
@sinewalker
sinewalker / slack-dark.css
Created May 26, 2019 — forked from Icebird/slack-dark.css
Slack Desktop Dark Theme CSS
View slack-dark.css
/*
Activate by appending this code to the end of ~\AppData\Local\slack\app-3.3.8\resources\app.asar.unpacked\src\static\ssb-interop.js
document.addEventListener('DOMContentLoaded', function() {
$.ajax({
url: 'https://gist.githubusercontent.com/Icebird/638220c4b3eb7f68c39431740fbd7eb7/raw/slack-dark.css',
success: function(css) {
$("<style></style>").appendTo('head').html(css);
}
});
@sinewalker
sinewalker / freezenv.sh
Created May 21, 2019
Freeze your python pip requirements to a known place, to guard against Homebrew mess-ups
View freezenv.sh
freezenv() {
FUNCDESC='Freeze the active Python Environment pip requirements.
This stores the requirements.txt in the active $VIRTUAL_ENV or $CONDA_PREFIX
directory, overwriting any existing requirements file.'
if [[ -z ${VIRTUAL_ENV-$CONDA_PREFIX} ]] ; then
error "$FUNCNAME: no active python or conda venv"
return 1
fi
@sinewalker
sinewalker / minecraft-coords.md
Created May 18, 2019
Minecraft Pi Edition Python Coords vs Minecraft Debugging Coords
View minecraft-coords.md

To fix your Minecraft world so that the coordinates displayed on the F3 debugging screen match what the MCPI API tells you with player.getPos() or player.getTilePos(), issue this Command in the game (requires Multiplayer, or a World generated with Cheat Codes enabled):

/setworldspawn 0 0 0

(to do this, press T or / and then type /setw followed by the TAB key, and then 0 0 0. For some reason you can't type this command out in full on the Talk window.)


@sinewalker
sinewalker / wtfo.sh
Created May 13, 2019
wtfo -- fix wtf -o option's error message when it can't find an abbreviation
View wtfo.sh
function wtfo(){
FUNCDESC="Look up an abbreviation, including obscene meanings"
wtf -o ${@}|sed 's/nothing appropriate/nothing inappropriate/'
}
@sinewalker
sinewalker / subdir-files-completion.sh
Last active May 10, 2019
Bash completion for all files in all subdirectories of a directory
View subdir-files-completion.sh
function _subfiles() {
COMPREPLY=()
local CUR FILES
CUR="${COMP_WORDS[COMP_CWORD]}"
FILES="$(find ${_COMP_DIR}/* -type f|awk -F ${_COMP_DIR}/ '{print $2}')"
COMPREPLY=( $(compgen -W "${FILES}" -- ${CUR}) )
return 0
}
You can’t perform that action at this time.