Skip to content

Instantly share code, notes, and snippets.

Verifying that "moonhouse.id" is my Blockstack ID. https://onename.com/moonhouse
Simsport är så spännande att det ger dig simhud.
{"p_8":"0","p_7":"0","p_6":"0","p_5":"0","p_4":"0","p_3":"0","p_2":"10","p_1":"0"}
{"p_8":"1","p_7":"1","p_6":"1","p_5":"1","p_4":"1","p_3":"1","p_2":"0","p_1":"1"}
Verkligheten är alltid mer spännande än fiktion.
{"p_8":"2","p_7":"0","p_6":"0","p_5":"0","p_4":"2","p_3":"0","p_2":"0","p_1":"6"}
{"p_8":"0","p_7":"0","p_6":"2","p_5":"2","p_4":"0","p_3":"6","p_2":"0","p_1":"0"}
Ja för en tuff boxningsfilm en fredagskväll?
{"p_8":"0","p_7":"0","p_6":"0","p_5":"10","p_4":"0","p_3":"0","p_2":"0","p_1":"0"}
@moonhouse
moonhouse / steps.sh
Created September 16, 2016 19:40
Installing apcmm on MacOS X
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
pip install cython
brew install liblo
pip install -r requirements.txt
python setup.py install
pip install pygame
brew install portmidi
@moonhouse
moonhouse / youtube-subscriber.30m.sh
Last active March 6, 2016 23:20
Print subscriber count from a Youtube channel. Can be used with BitBar. Replace YOURAPIKEY with an actual Youtube API key from https://console.developers.google.com/
#!/bin/sh
curl 'https://www.googleapis.com/youtube/v3/channels?part=statistics&id=UCSGHj0YjencmGUSksbMbBVQ&key=YOURAPIKEY' 2>/dev/null | grep -o '"subscriberCount": "\d*"' | tr -d -c 0-9
@moonhouse
moonhouse / parse_pontus-rb
Created September 8, 2015 07:31
Ta fram dagens meny från Pontus utifrån deras meny-PDF
require 'pdf-reader'
weekdays = %w{Söndag Måndag Tisdag Onsdag Torsdag Fredag Lördag}
reader = PDF::Reader.new("P4_V.37.-15.pdf")
page = reader.pages.first
week_menu = {}
week_menu.default = ''
current_weekday = ''
#!/bin/sh
while true; do
# Clean up previously running apps, gracefully at first then harshly
killall -TERM chromium 2>/dev/null;
killall -TERM matchbox-window-manager 2>/dev/null;
sleep 2;
killall -9 chromium 2>/dev/null;
killall -9 matchbox-window-manager 2>/dev/null;
@moonhouse
moonhouse / rc.local-2
Created May 27, 2015 15:36
With that all done, the installation needs to be told to start-up X using a tailored xinitrc (kept on the boot-partition so that it can easily be edited on a non-Linux machine) by adding the following to /etc/rc.local:
if [ -f /boot/xinitrc ]; then
ln -fs /boot/xinitrc /home/pi/.xinitrc;
su - pi -c 'startx' &
fi
@moonhouse
moonhouse / rc.local
Created May 27, 2015 15:35
Next, add this to /etc/rc.local; it waits for a monitor to be attached to the HDMI socket, probes it for its preferred mode, sets that preferred mode and finally resets the framebuffer ready for X to takeover:
# Wait for the TV-screen to be turned on...
while ! $( tvservice --dumpedid /tmp/edid | fgrep -qv 'Nothing written!' ); do
bHadToWaitForScreen=true;
printf "===> Screen is not connected, off or in an unknown mode, waiting for it to become available...\n"
sleep 10;
done;
printf "===> Screen is on, extracting preferred mode...\n"
_DEPTH=32;
eval $( edidparser /tmp/edid | fgrep 'preferred mode' | tail -1 | sed -Ene 's/^.+(DMT|CEA) \(([0-9]+)\) ([0-9]+)x([0-9]+)[pi]? @.+/_GROUP=\1;_MODE=\2;_XRES=\3;_YRES=\4;/p' );
@moonhouse
moonhouse / config.log
Last active August 29, 2015 14:20
SphinxTrain configure 5prealpha, which was generated by GNU Autoconf 2.69.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by SphinxTrain configure 5prealpha, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
@moonhouse
moonhouse / cmu-sphinxtrain.txt
Created May 2, 2015 18:25
brew install --HEAD watsonbox/cmu-sphinx/cmu-sphinxtrain
➜ ~ brew tap watsonbox/cmu-sphinx
==> Tapping watsonbox/cmu-sphinx
Cloning into '/usr/local/Library/Taps/watsonbox/homebrew-cmu-sphinx'...
remote: Counting objects: 41, done.
remote: Total 41 (delta 0), reused 0 (delta 0), pack-reused 41
Unpacking objects: 100% (41/41), done.
Checking connectivity... done.
Warning: Could not create link for watsonbox/cmu-sphinx/cmu-pocketsphinx, as it
conflicts with Homebrew/homebrew/cmu-pocketsphinx. You will need to use the
fully-qualified name when referring this formula, e.g.