Skip to content

Instantly share code, notes, and snippets.

View kiliankoe's full-sized avatar
👩‍💻

Kilian Koeltzsch kiliankoe

👩‍💻
View GitHub Profile
@kiliankoe
kiliankoe / catfacts.json
Last active March 27, 2025 08:07
THANK YOU FOR SUBSCRIBING TO CATFACTS™
{
"facts": [
"Unlike dogs, cats do not have a sweet tooth. Scientists believe this is due to a mutation in a key taste receptor.",
"When a cat chases its prey, it keeps its head level. Dogs and humans bob their heads up and down.",
"The technical term for a cat’s hairball is a “bezoar.”",
"A group of cats is called a “clowder.”",
"A cat can’t climb head first down a tree because every claw on a cat’s paw points the same way. To get down from a tree, a cat must back down.",
"Cats make about 100 different sounds. Dogs make only about 10.",
"There are more than 500 million domestic cats in the world, with approximately 40 recognized breeds.",
"While it is commonly thought that the ancient Egyptians were the first to domesticate cats, the oldest known pet cat was recently found in a 9,500-year-old grave on the Mediterranean island of Cyprus. This grave predates early Egyptian art depicting cats by 4,000 years or more.",
@kiliankoe
kiliankoe / day3part1.py
Created December 3, 2022 12:30
Advent of Code 2022 Day 3 as solved by OpenAI's ChatGPT
# Read the input from the file
with open("input.txt") as f:
rucksacks = f.readlines()
# Initialize the sum of priorities to 0
sum_of_priorities = 0
# Loop over each rucksack
for rucksack in rucksacks:
# Split the rucksack into two compartments
@kiliankoe
kiliankoe / NeverAirpods.swift
Created January 17, 2021 00:47
Never let macOS use my AirPods as an input device
import Foundation
import ShellOut
do {
try shellOut(to: "SwitchAudioSource -a")
} catch {
print("Couldn't find SwitchAudioSource.")
print("Please install switchaudio-osx via homebrew.")
exit(1)
}
@kiliankoe
kiliankoe / MapView.swift
Created September 30, 2019 20:10
3D MapKit Views
import SwiftUI
struct MapView: UIViewRepresentable {
var coordinate: CLLocationCoordinate2D
func makeUIView(context: Context) -> MKMapView {
MKMapView(frame: .zero)
}
func updateUIView(_ view: MKMapView, context: Context) {
@kiliankoe
kiliankoe / tweetdump_dvbag.py
Last active October 14, 2017 21:09
Download last ~2k @DVBAG tweets - Twitter API limits to 3.2k, but filter replies and "old-style" RTs
#!/usr/bin/env python
import csv
import re
import datetime
from time import mktime
from tweepy import OAuthHandler
from tweepy import API
#!/bin/sh
# Supported desktop environments
# 1. Aqua (MacOS)
# 2. Gnome
# 3. Unity
# 4. Feh
# 5. xfce4
# 6. KDE
@kiliankoe
kiliankoe / error.rs
Last active January 18, 2017 15:45
Returning results and options in Rust and Swift
enum TestErr {
MuchFatalSuchWow,
}
fn return_result() -> Result<String, TestErr> {
// String::new() // doesn't work
// TestErr::MuchFatalSuchWow // doesn't work
Err(TestErr::MuchFatalSuchWow)
}
POST http://webapi.vvo-online.de/dm?format=json
Accept: application/json, text/plain, */*
{
"stopid": "33000037",
"time": "2016-11-13T16:01:12Z",
"isarrival": false,
"limit": 30,
"shorttermchanges": true,
package main
import (
"bytes"
"encoding/json"
"fmt"
"html"
"io/ioutil"
"net/http"
"os"
#import <Foundation/Foundation.h>
@interface Person : NSObject
{
@private char *name;
}
@property (readwrite, assign) char *name;
- (void)sayHello;
@end