Skip to content

Instantly share code, notes, and snippets.

🙂

Arno oelna

🙂
Block or report user

Report or block oelna

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
@oelna
oelna / hs_decode.py
Created Jun 11, 2019
Hearthstone decklist decode
View hs_decode.py
#!/usr/bin/python
# modified for brevity from https://github.com/HearthSim/python-hearthstone/blob/master/hearthstone/deckstrings.py
import base64
from io import BytesIO
from typing import IO, List, Tuple
DECKSTRING_VERSION = 1
@oelna
oelna / resize_images.sh
Created Sep 3, 2018
A bash script to batch resize images on macOS, possibly through an Automator Service (uses sips, ImageOptim)
View resize_images.sh
for f in "$@"
do
dir=$(dirname "${f}")
filename=$(basename -- "$f")
extension="${filename##*.}"
filename="${filename%.*}"
# array of pixel sizes (widths) to generate
sizes=(600 1200)
@oelna
oelna / applescript.scpt
Created Jun 21, 2018
macOS Automator Action to calculate file hashes
View applescript.scpt
on run {input, parameters}
with timeout of 360 seconds
tell application "System Events"
activate
display dialog input buttons {"OK"} default button 1 with title "File Hashes" giving up after 300 --seconds
end tell
end timeout
end run
@oelna
oelna / polychromie-architecturale.json
Created Apr 11, 2017
Le Corbusier's "Polychromie Architecturale" – all 63 colors as hex values, with their original name, ID and lightness coefficient (HBW) in a neat JSON array
View polychromie-architecturale.json
[
{
"hex":"fff1ce",
"name":"blanc",
"hbw":72,
"id":"32001",
"collection":1931
},{
"hex":"585d5e",
"name":"gris foncé 31",
@oelna
oelna / bingo.php
Last active Jun 22, 2019
A generator for unique Bingo cards in PHP. See in action https://bingo.arnorichter.de/ (generates cards printable on A4 paper size)
View bingo.php
<?php
/*
Generate however many unique bingo cards you require (should be fewer than 10k though).
This is not meant to compute ALL possible bingo cards, obviously, but to help set up a
nice amount of cards for play.
If you require a free space somewhere on the board, you should probably tweak the output,
not the generator.
I wrote this because existing solutions on stackoverflow were in languages I could not
test as easily and many existing generator websites generate crap cards that do not
adhere to the bingo number distribution in the 5 rows, so you spend an eternity looking
@oelna
oelna / Readme.md
Last active Jan 19, 2017
Clean an iTunes M4A audio track from all identifying/personal information with AtomicParsley and Python
View Readme.md

What is this

This python script is a radical attempt to remove all personal information from iTunes M4A audio tracks. All ID3 information will be lost in the process, sadly. You need to figure out a special offset in one of your audio files in a hex editor for this to work. If you are looking for a very simple solution, this is not your script.

If this helps you, please consider tipping to make up for the ridiculous amount of time I lost putting this together:
Gittip Flattr

Instructions for macOS (was OS X)

@oelna
oelna / closest.js
Created Nov 8, 2016
A vanilla javascript method that returns the closest DOM ancestor that matches a selector, or null.
View closest.js
var closest = function(selector, ele) {
if(!selector || !ele) return null;
//polyfill .matches()
if(Element && !Element.prototype.matches) {
Element.prototype.matches = Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector;
}
if(ele.matches(selector)) return ele; //return self if it matches
@oelna
oelna / crontab
Last active Jun 6, 2016
Fever RSS reader modification so it can be run via cronjob php call (without curl)
View crontab
*/20 * * * * php /path/to/your/fever/index.php refresh
# or, as in my case, with php-cgi
*/20 * * * * php-cgi /path/to/your/fever/index.php refresh
@oelna
oelna / imaptransfer.php
Created Jun 5, 2016
A small utility that copies mailboxes from one IMAP account to another.
View imaptransfer.php
<?php
/*
This code is based heavily on the instructions given on http://egil.biz/migrate-e-mail-over-imap-with-php/
Many hours on Stackoverflow have been spent trying to make this.
I tried to clean it up, make it readable, add a nicer UI and feedback about errors.
If you like this, use this or it helps you, I'm happy to hear about it.
Drop me a line if you have feedback, too.
2016-06-05, Arno Richter <mail@arnorichter.de>
@oelna
oelna / convert.php
Last active Jul 14, 2019
A small utility webapp that converts between various string encodings and cleans up text
View convert.php
<?php
//check for PHP version requirements
if(version_compare(phpversion(), '5.3.0', '<')) die('This requires at least PHP 5.3 to run.');
date_default_timezone_set('Europe/Berlin');
$conversions = array(
array(
'text' => 'UTF-8 Decode',
'function' => function($input) {
return utf8_decode($input);
You can’t perform that action at this time.