Skip to content

Instantly share code, notes, and snippets.

@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 / listAllEventListeners.js
Last active January 24, 2024 22:52 — forked from dmnsgn/listAllEventListeners.js
List all event listeners in a document
console.table((function listAllEventListeners() {
const allElements = Array.prototype.slice.call(document.querySelectorAll('*'));
allElements.push(document); // we also want document events
const types = [];
for (let ev in window) {
if (/^on/.test(ev)) types[types.length] = ev;
}
let elements = [];
for (let i = 0; i < allElements.length; i++) {
@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 / migrate google suite legacy to gmail.sh
Created January 21, 2022 12:31
Migrate emails from Google Workspace/G suite legacy to free gmail account with https://github.com/jay0lee/got-your-back
# backup from g suite
~/bin/gyb/gyb --action create-project --email youremail@yourdomain.com
~/bin/gyb/gyb --email youremail@yourdomain.com --action backup
# now delete (or preferrably backup) two secrets file in ~/bin/gyb because they contain login for G suite, and GYB is primarily meant for migration between two accounts in a same workspace - see https://github.com/GAM-team/got-your-back/issues/274
# and restore to freemail account
~/bin/gyb/gyb --action create-project --email yourfreeemail@gmail.com
~/bin/gyb/gyb --email yourfreeemail@gmail.com --action restore --local-folder ~/GYB-GMail-Backup-youremail@yourdomain.com --label-restored "Migration"