Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Directory of PNG images to process
DIRECTORY="./fastlane/screenshots"
# Check if mogrify command is available
if ! command -v mogrify &>/dev/null; then
echo "mogrify could not be found. Please install ImageMagick (brew install imagemagick)."
exit 1
fi
@tkafka
tkafka / 01 anamnesis cs.md
Last active March 4, 2024 21:33
https://www.libor-lepka.cz - the original text roughly rewritten into markdown, dates converted to english format, and machine translated with deepl, as an input for GPT4

Prosím veřejnost odbornou i neodbornou o pomoc při hledání diagnózy

Po více než dvou letech bolestí a neustálém zhoršování stavu nabízím komukoli za správnou diagnózu, která povede k vyléčení, nebo alespoň remisi a odstranění bolestí veškeré peníze, které aktuálně mohu - 100 000Kč

Popis problémů

Více než dva roky trvající, každodení bolesti kloubů a zad.

Bolesti začaly cca před 2 lety napřed na kloubech 2 prstů a v loktech. Po celý následující rok žádná změna, na podzim 2022 se v rychlém sledu rozšířily do dalších malých kloubů, kyčlí, kotníků a ramen. Vždy symetricky. V průběhu roku 2023 pak do spodní části zad, poté za krk. Poté začaly bolet i různé šlachy, úpony – paty, dlaně, strany lýtek.

@tkafka
tkafka / gist:ae2b0af7e6607df4f0dcea6fc08d87d3
Created November 27, 2023 11:03 — forked from levelsio/gist:5bc87fd1b1ffbf4a705047bebd9b4790
Secret of Monkey Island: Amsterdam (by @levelsio) or how to create your own ChatGPT image+text-based adventure game
2023-11-27 MIT LICENSE
Here's the open source version of my ChatGPT game MonkeyIslandAmsterdam.com.
It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town.
Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this.
It's much easier than you think and you'll be shocked by how relatively well it works with little work.
#!/bin/zsh -f
PATH=/bin
bin="${HOME}/.Trash/$(date -u +%Y-%m-%dT%H-%M-%SZ)"
if (( ${?} > 0 )); then
exit 1
fi
@tkafka
tkafka / embed-binary.sh
Created September 4, 2023 10:01
Embeds a binary data from file into a Swift class static variable (with cached decode)
#!/bin/bash
# Embeds a binary data from file as a static variable (with cached decode)
# Made by chatgpt: https://chat.openai.com/share/0d05b3a8-d25c-4226-876a-62868d3c0e88
# Check if a valid number of arguments are provided (must be multiple of 2)
if [ $(($# % 2)) -ne 0 ] || [ "$#" -eq 0 ]; then
echo "Usage: $0 <property_name1> <binary_file1> [<property_name2> <binary_file2> ...]"
exit 1
fi
@tkafka
tkafka / README.md
Last active April 20, 2023 16:25
Generator kontrolniho hlaseni pro prijmy z App Store (= ireland, prenesena danova povinnost).
export function wrapInErrorHandler<Func extends (...args: any[]) => any>(func: Func): (...args: InferArguments<Func>) => InferReturn<Func> {
return function (...args: InferArguments<Func>) {
try {
return func.apply(null, args);
} catch (err: any) {
if (err instanceof LoggedError) {
throw err;
}
post({ your- error - object});
throw new LoggedError(err);
@tkafka
tkafka / ComplicationAnimationView.swift
Created October 23, 2022 22:58
A rough example of a looping SwiftUI animation
import Foundation
import SwiftUI
struct ComplicationAnimationView: View {
let titlePadding = EdgeInsets(top: 8, leading: 0, bottom: 0, trailing: 0)
var aspectRatio: CGFloat = 1.2
let imageAspectRatio: CGFloat = 757 / 224
var loopingAnimation: Animation {
Animation.linear(duration: 15).repeatForever(autoreverses: false)
/* See https://gist.github.com/tkafka/979ce34a677dbe3d2d8a552e60382e50 */
:root {
--primary-color: #0074d9 !important;
}
html {
background-color: white !important;
}
@tkafka
tkafka / AuthyToOtherAuthenticator.md
Created April 7, 2022 20:35 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the