Skip to content

Instantly share code, notes, and snippets.

@bersling
bersling / EmojiLetterCap.svelte
Last active May 25, 2023 21:29
EmojiLetter for Mobile
<script lang="ts">
import { Capacitor } from '@capacitor/core';
let emojis = [
'😀',
'😃',
'😄',
'😁',
'😆',
'😅',
<script lang="ts">
let emojis = [
'😀',
'😃',
'😄',
'😁',
'😆',
'😅',
'😂',
'🤣',
@bersling
bersling / svelte-capacitor-recipe.md
Last active March 5, 2024 14:50
Svelte-Capacitor-Recipe
kubectl config use-context example/tb:prod
kubectl apply -f ./k8s/namespaces/exampleproject.yaml
kubectl config set-context --current --namespace=exampleproject
helm upgrade --install exampleproject-ingress ./k8s/helm/xxx --values=exampleproject/k8s/prod/exampleproject-ingress.values.yaml
helm upgrade --install exampleproject ./k8s/helm/tb-deployment --values=exampleproject/k8s/prod/exampleproject-deployment.values.yaml --set image.repositoryWithTag="$EXAMPLEPROJECT_IMAGE"
kubectl rollout status deployment/exampleproject
@bersling
bersling / search-my-masto-posts.js
Last active April 21, 2023 07:57
Mastodon Browser Search
// There were mentions that the default mastodon client does not let you search in your posts
// e.g. https://infosec.exchange/@codinghorror/110232149814997656
// This is a hacky function to fetch all posts and search through them. Use and adapt at your own risk.
// Usage:
// 1. Navigate to your mastodon server
// 2. Open browser console
// 3. Copy paste the function
// 4. Execute the function for example like this: searchPosts("techhub.social", "bersling", "something")
import java.security.KeyFactory
import java.security.interfaces.RSAPublicKey
import java.security.spec.X509EncodedKeySpec
import java.util.Base64.getDecoder
/*
* Utility Method to convert a public key in the form of a string into a RSAPublicKey object.
* Helpful for example for verifying JWT signatures!
* */
fun convertPublicKeyStringToRSAPublicKey(publicKey: String): RSAPublicKey {
@bersling
bersling / addborders.py
Last active November 1, 2020 13:51
Adding White Borders to an Image (for Instagram) through the commandline
import subprocess
import sys
from PIL import Image
# Read the filename from the command line args
filename = sys.argv[1]
# Read in the image
image = Image.open(filename)
Äntefudi Quackquackquack het am Fudi Siegellack, Siegellack goht nümme ab, Äntefudi Quackquackquack