Skip to content

Instantly share code, notes, and snippets.

Avatar

Youri op 't Roodt optroodt

View GitHub Profile
@optroodt
optroodt / instructions.txt
Created May 31, 2020
Build forked-daapd for Raspberry Pi Model B
View instructions.txt
Latest Raspbian (2020-02-14) based on Debian 10 Buster
====
# Add ssh file to boot partition
sudo apt-get update
sudo apt-get install \
build-essential git autotools-dev autoconf automake libtool gettext gawk \
gperf antlr3 libantlr3c-dev libconfuse-dev libunistring-dev libsqlite3-dev \
libavcodec-dev libavformat-dev libavfilter-dev libswscale-dev libavutil-dev \
libasound2-dev libmxml-dev libgcrypt20-dev libavahi-client-dev zlib1g-dev \
@optroodt
optroodt / remove_trailing_whitespace.sh
Created Dec 5, 2019
Remove trailing whitespace with sed on os X
View remove_trailing_whitespace.sh
find . -iname "*.py" -exec sed -i '' -E 's/[ '$'\t'']+$//' {} \;
@optroodt
optroodt / generate.py
Created Nov 15, 2019
Generate 1000 text files with random words
View generate.py
import pathlib
import random
dictionary = pathlib.Path("/usr/share/dict/web2") # It's there on MacOS
words = set()
with dictionary.open("r") as f:
for l in f:
words.add(l.strip())
@optroodt
optroodt / on_exception.py
Created Aug 5, 2019
Start (i)pdb on exception
View on_exception.py
python -m pdb -c continue myscript.py
View gist:b1bb3b3d1edbcefb31f3c621abd7065c
# uninstall packages installed by pip
pip freeze | xargs pip uninstall -y
# see which packages depend on a package:
pip show <insert_package_name_here>| grep ^Require
@optroodt
optroodt / sublime-keymap.json
Created Mar 27, 2018
OS X Eclipse key bindings for Sublime Text 3
View sublime-keymap.json
[
{ "keys": ["alt+up"], "command": "swap_line_up" },
{ "keys": ["alt+down"], "command": "swap_line_down" },
{ "keys": ["super+alt+down"], "command": "duplicate_line" },
{ "keys": ["super+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} },
{ "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line.sublime-macro"} },
]
View joey-joebags.md

How to get BennVenn' joey-joebags working on macOS

The joey-joebags is a Game Boy cart reader/writer, it's available here.

I have tested these steps on Yosemite (10.10) and Sierra (10.12). You need to have Python 3, which is not installed by default, so install using Homebrew.

Install Homebrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

@optroodt
optroodt / gist:8298148
Created Jan 7, 2014
Extract single table from mysql dump file.
View gist:8298148
sed -n -e '/CREATE TABLE.*tablename/,/CREATE TABLE/p' database.sql > table.sql
You can’t perform that action at this time.