Skip to content

Instantly share code, notes, and snippets.

Python 10 hrs 20 mins ███████████████▏░░░░░ 72.1%
TypeScript 1 hr 20 mins █▉░░░░░░░░░░░░░░░░░░░ 9.4%
JSON 43 mins █░░░░░░░░░░░░░░░░░░░░ 5.0%
TOML 21 mins ▌░░░░░░░░░░░░░░░░░░░░ 2.5%
SQL 17 mins ▍░░░░░░░░░░░░░░░░░░░░ 2.1%
⭐ Total Stars: 634
➕ Total Commits: 4,466
🔀 Total PRs: 299
🚩 Total Issues: 235
📦 Contributed to: 32
@kytta
kytta / tcp.py
Last active April 21, 2024 15:15
TCP packet built from scratch in Python 3
# tcp.py -- example of building and sending a raw TCP packet
# Copyright (C) 2020 Nikita Karamov <nick@karamoff.dev>
#
# With code from Scapy (changes documented below)
# Copyright (C) 2019 Philippe Biondi <phil@secdev.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
@kytta
kytta / emojiFlag.js
Created March 18, 2024 11:24
Get the emoji flag for an ISO-3166-1 alpha-2 country code.
/**
* Return the emoji flag for an ISO-3166-1 alpha-2 country code.
*
* The ISO code should be a string consisting of two latin characters
* (case-insensitive). Note that this method *does not* check the validity
* of the provided ISO code.
*
* @param {string} isoCode
* ISO-3166-1 alpha-2 country code
* @return {string} the emoji of the country's flag
@kytta
kytta / mastodon.log
Created July 3, 2023 12:33
Logcat output when trying to translate a piece of text in Mastodon v2
2023-07-03 14:30:26.375 10998-10998 AutofillManager org.joinmastodon.android V requestHideFillUi(null): anchor = null
2023-07-03 14:30:26.464 10998-10998 oplus.andr...actoryImpl org.joinmastodon.android I get feature:IOplusDynamicVsyncFeature
2023-07-03 14:30:26.464 10998-10998 oplus.andr...actoryImpl org.joinmastodon.android I get feature:IOplusDynamicVsyncFeature
2023-07-03 14:30:26.464 10998-10998 oplus.andr...actoryImpl org.joinmastodon.android I get feature:IOplusDynamicVsyncFeature
2023-07-03 14:30:26.490 10998-11156 MastodonAPIController org.joinmastodon.android D [fosstodon.org_107218015383863784] Sending request: Request{method=GET, url=https://fosstodon.org/api/v1/statuses/110649998033991795/context, tags={}}
2023-07-03 14:30:26.493 10998-10998 Quality org.joinmastodon.android I Skipped: false 3 cost 66.023094 refreshRate 0 processName org.joinmastodon.android
2023-07-03 14:30:26.554 10998-10998 Q
@kytta
kytta / new-iterm2-window.applescript
Created May 6, 2023 11:19
AppleScript to open a new iTerm2 window (Raycast compatible)
#!/usr/bin/osascript
# This is free and unencumbered software released into the public domain.
# SPDX-License-Identifier: Unlicense OR CC0-1.0
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title New iTerm2 Window
# @raycast.mode silent
# Optional parameters:
@kytta
kytta / count.lite.js
Created February 24, 2023 00:35
A very lightweight GoatCounter count script. It only counts the visit without transferring too much data. Perfect for single-page websites.
// Only count the production website
// TODO: You should replace these with your webpage production URL
if (window.location.host === "domain.tld") {
// Check if the default GC URL resolves
// This allows us to not track people with ad blockers
fetch("//gc.zgo.at/", { method: "HEAD" })
.then((result) => {
if (!result.ok) {
return;
}
@kytta
kytta / swiss_typography.css
Created February 19, 2023 18:09
Most Swiss default fonts
body {
font-family:
"Helvetica Neue", /* macOS - basically our goal */
"Neue Haas Grotesk Text Pro", /* Windows - part of the "Pan-European Supplemental Fonts" package */
Helvetica, /* macOS - also the classic */
"FreeSans", /* Linux - made by GNU, can be installed on most systems */
Arial, /* macOS and Windows - part of the "Core fonts for the Web" */
system-ui, /* if for some reason we're here - let's hope that the system UI font is Swiss */
sans-serif; /* most generic fallback */
}
@kytta
kytta / 2022-11-29-openpgp_key_transition.txt
Created November 29, 2022 01:37
The 2022 OpenPGP key transition
Title: The 2022 OpenPGP key transition
Author: Nikita Karamov
Date: 29 Nov 2022
What follows is a quite long explanation as to what happened to my OpenPGP keys.
TL;DR: Do not use these RSA keys any more:
- 0xF0A49E6D84E6EEBE
@kytta
kytta / openpgp.md
Last active November 29, 2022 00:41