Skip to content

Instantly share code, notes, and snippets.

View kaplas's full-sized avatar

Jouni Kaplas kaplas

View GitHub Profile
@kaplas
kaplas / batocera.conf
Created January 31, 2023 06:27
Using 8BitDo N30 2.4g wireless controller with Batocera
# Add these lines to /system/batocera.conf to remap save state and load state to [Hotkey]+[DPad left/right]
global.retroarch.input_save_state_btn=h0right
global.retroarch.input_save_state_axis=+0
global.retroarch.input_load_state_btn=h0left
global.retroarch.input_load_state_axis=-0
global.retroarch.input_hold_fast_forward_btn=nul
global.retroarch.input_hold_fast_forward_axis=nul
global.retroarch.input_rewind_btn=nul
@kaplas
kaplas / wine-on-moderns-macs.md
Created February 12, 2022 15:57
Wine on modern Macs

How to install Wine on modern Macs (and run tappio.exe)

  1. (Not sure if really needed) brew tap gcenx/wine
  2. brew install --cask --no-quarantine gcenx/wine/wine-crossover
  3. wine tappio-setup.exe
  4. wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Tappio/tappio.exe
@kaplas
kaplas / rpi3-dietpi-upnp-renderer.md
Created May 8, 2020 12:05
Setting up a RPi3 to work as a dedicated UPnP renderer

Setting up a RPi3 to work as a dedicated UPnP renderer

From https://dietpi.com/phpbb/viewtopic.php?p=9#p9

  • Download the latest DietPI image
  • Write the image to an SD card (eg. with BalenaEtcher on MacOS)
  • Edit WiFi details to /boot/dietpi-wifi.txt, if you plan to use WiFi. I wasn't able to get WiFI to work later on anymore, so please fill the details already now.
  • Start the RPi3 with the SD card
  • Find out the IP address of the device, and log in via SSH (username root, password dietpi)
  • Setup utility starts on login, and guides you through via the steps needed. This will take some time though.
@kaplas
kaplas / youtube-to-podcast.md
Created May 4, 2020 06:29
Convert a Youtube channel into a podcast

Convert a Youtube channel into a podcast

Requirements

  • youtube-dl

Step 1: Download all videos of a channel as 64 kbps mono mp3s

youtube-dl \
@kaplas
kaplas / speedtest.sh
Created February 3, 2018 12:51
Speedtest → IFTTT
/usr/local/bin/speedtest-cli --json | \
jq '{ Value1: (.download/1024/1024), Value2: (.upload/1024/1024), Value3: .ping }' | \
curl -sS -X POST -H 'Content-Type: application/json' -d @- https://maker.ifttt.com/trigger/your_event_name/with/key/your_secret_key

Miten Tappion saa toimimaan macOS:lla

  1. Asenna XQuartz 2.7.9. Tämä vanhempi versio toimii paremmin fonttien kanssa.
  2. Asenna/Päivitä homebrew
  3. Asenna xcode ja komentorivityökalut (sudo xcodebuild -license, xcode-select --install)
  4. brew install wine winetricks
  5. Luo uusi 32-bittinen wine prefix (WINEARCH=win32 WINEPREFIX=~/.wine32prefix winecfg)
  6. Lataa Tappion asennusohjelma ja asenna se: WINEARCH=win32 WINEPREFIX=~/.wine32prefix wine tappio-setup.exe
  7. WINEARCH=win32 WINEPREFIX=~/.wine32prefix winetricks settings fontsmooth=rgb
  8. WINEARCH=win32 WINEPREFIX=~/.wine32prefix wine ~/.wine32prefix/drive_c/Program\ Files/Tappio/tappio.exe
#!/bin/bash
set -e
if [[ "$1" != /* ]]; then
# Relative path name
FILENAME_WITH_EXT=$(basename "$1")
FILENAME="${FILENAME_WITH_EXT%.*}"
ABSPATH=$(unset CDPATH && cd "$(dirname "$0")" && echo $PWD)
DIRNAME="$ABSPATH/$FILENAME"
FILEEXT="${FILENAME_WITH_EXT##*.}"
@kaplas
kaplas / what-kind-of-designers-will-the-world-need.md
Last active February 16, 2017 10:37
What kind of Designers will the World need?

What kind of Designers will the World need?

A co-worker of mine is switching her career from user interface more into front-end development. She asked me: "From your Point-of-View, what should I focus on? Should I learn to code better, so I could work on both design and development? Or should I focus on finetuning the user interactions, animations, and things like those?"

Let's be frank: I'm a developer, I've always been a developer, and thus I have a developer's mindset. I can not talk too much about design, but I figured out, that I can talk about is what I see happening around. And from my Point-of-View, that is that designers are shifting more and more into prototyping in code and designing ready-to-be-used UI components.

I think that is a tremendously good way to go, because then co-operation with different disciplines increase, designers can more ensure that their designs are being used more correctly, and stuff doesn't need to be implemented "twice" in

@kaplas
kaplas / fb-blocker.user.js
Last active January 6, 2016 11:31 — forked from mehedihasan/fb.blocker.user.js
Block/Hide Facebook elements (and do something useful with that time of yours instead!)
// ==UserScript==
// @name Facebook Blocker (by Jouni Kaplas)
// @namespace net.kaplas.fb-blocker
// @include https://*.facebook.com/*
// @include https://facebook.com/*
// @include http://*.facebook.com/*
// @include http://facebook.com/*
// @version 1
// @grant none
// @downloadURL https://gist.github.com/kaplas/31cf00f605667f7430d9/raw/
@kaplas
kaplas / applescripts.md
Last active January 21, 2016 17:10
A collection of useful AppleScripts

A collection of useful AppleScripts, usually to be used with OS X Automator