Skip to content

Instantly share code, notes, and snippets.

@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.
@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

@tkafka
tkafka / opengraph.template.html
Last active March 16, 2020 17:40 — forked from druellan/opengraph.template.html
Basic template for OpenGraph/Facebook metatags
Detail
<html prefix="og: http://ogp.me/ns#">
<head>
<title>{advert.title ořezaný na 60 znaků, případně s trojtečkou pokud jsme ho ořezali} · dobro.cz</title> <!-- ˜60 chars -->
<meta name="description" content="Nabídka pomoci na dobro.cz — pomáhejme si v době koronaviru"> <!-- Nabidka ˜150 chars -->
<meta name="description" content="Žádost o pomoc na dobro.cz — pomáhejme si v době koronaviru"> <!-- Poptavka ˜150 chars -->
<meta property="og:title" content="{advert.title}">
<meta property="og:description" content="Nabídka pomoci na dobro.cz — pomáhejme si v době koronaviru"> <!-- Nabidka -->
<meta property="og:description" content="Žádost o pomoc na dobro.cz — pomáhejme si v době koronaviru"> <!-- Poptavka -->
@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 / install_git_lfs.sh
Last active May 31, 2019 17:02 — forked from show0k/install_git_lfs.sh
Compile and Install git-lfs on Raspberry Pi (with golang compilation)
install_git_lfs()
{
set -e
# Get out if git-lfs is already installed
if $(git-lfs &> /dev/null); then
echo "git-lfs is already installed"
return
fi
GIT_LFS_BUILD=$HOME/.bin
(function($) {
// Add inner and outer width to zepto (adapted from https://gist.github.com/alanhogan/3935463)
var ioDim = function(dimension, includeBorder) {
return function (includeMargin) {
var sides, size, elem;
if (this) {
elem = this;
size = elem[dimension]();
sides = {
width: ["left", "right"],
@tkafka
tkafka / peakdetect.py
Created January 17, 2012 23:10 — forked from sixtenbe/analytic_wfm.py
Peak detection in Python
import numpy as np
def peakdetect(y_axis, x_axis = None, lookahead = 500, delta = 0):
"""
Converted from/based on a MATLAB script at http://billauer.co.il/peakdet.html
Algorithm for detecting local maximas and minmias in a signal.
Discovers peaks by searching for values which are surrounded by lower
or larger values for maximas and minimas respectively