Skip to content

Instantly share code, notes, and snippets.

View LukasKalbertodt's full-sized avatar
🦊

Lukas Kalbertodt LukasKalbertodt

🦊
View GitHub Profile
@LukasKalbertodt
LukasKalbertodt / _veggie-filter-lieferando.md
Last active March 13, 2023 17:05
Veggie filter for Lieferando

I cannot believe how Lieferando still has no filter for this. So here is my hacky "filter". It sets the background color of non veggie meals to red (or unsets it if it's already red). I just test for a list of German words. You probably want to adjust that.

Be aware, this is a shitty filter. Probably has lots of false positives and false negatives.

The best way to apply this is to create a new bookmark in your browser and copy the code into the target/URL field. This makes it a bookmarklet.

Licensed under CC-0.

@LukasKalbertodt
LukasKalbertodt / Chars.java
Created November 29, 2017 15:50
All valid unicode characters which can be a part of a java identifier
public class Chars {
public static void main(String[] args) {
int k = 0;
for (int i = 0x20; i < 0x10FFFF; i++) {
if (Character.isJavaIdentifierPart(i)) {
System.out.print(new String(Character.toChars(i)));
k++;
if (k == 32) {
System.out.println();
k = 0;
@LukasKalbertodt
LukasKalbertodt / 0-rust-wasm-llvm-backend.md
Last active September 22, 2020 12:18
Several Rust & WebAssembly notes

Compiling Rust to Wasm manually with the LLVM wasm-backend (without Emscripten)

EDIT November 2017: recently the target wasm32-unknown-unknown was added to rustc which uses the LLVM WASM backend and works without Emscripten. This is now the recommended way of generating WASM code from Rust (as it is much easier). Thus, this gist document is pretty much useless now. A great resource on getting started with WASM and Rust is hellorust.com: Setup and Minimal Example.




#!/bin/bash
TMP_PATH=/tmp/rust-blast-off-$(date +%s)
mkdir $TMP_PATH
### install rustup in tmp dir ###
echo "========================================="
echo "=== Just press Enter soon ;-) ==="
echo "========================================="
@LukasKalbertodt
LukasKalbertodt / EventManager.hpp
Created July 4, 2016 15:38
Just found this snippet of code... it's at least 3 years old. An exception-like event manager for games...
/**
* Template based Event-System by Lukas Kalbertodt <lukas.kalbertodt@gmail.com>
*/
#pragma once
// needed std headers
#include <map>
#include <memory>
#include <cstring>
#include <set>
@LukasKalbertodt
LukasKalbertodt / NiceExample.java
Last active November 21, 2017 16:27
Java Style Guide
/****************************** FormatExample.java **************************/
import AlgoTools.IO;
/**
* @author Willi Wacker <rzkuerzel@uos.de>
* @author Susi Sorglos <susi@sorglos.net>
*
* Ein sinnloses, aber schön formatiertes Beispiel
*
@LukasKalbertodt
LukasKalbertodt / Cargo.toml
Created October 12, 2015 00:32
Prime Sieve
[package]
name = "era"
version = "0.1.0"
authors = ["Lukas Kalbertodt <lukas.kalbertodt@gmail.com>"]
[dependencies]
time = "0.1"
bit-vec = "*"
@LukasKalbertodt
LukasKalbertodt / FormatExample.java
Last active August 29, 2015 14:09
Formatierung in Java: Ein Beispiel
/****************************** FormatExample.java **************************/
import AlgoTools.IO;
/**
* @author Lukas Kalbertodt <rzkuerzel@uos.de>
* @author Susi Sorglos <susi@sorglos.net>
*/
public class FormatExample {
import AlgoTools.IO;
import java.util.Scanner;
import java.io.*;
public class PrimeTest {
private static String m_program;
private static String m_yesString;
private static String m_noString;
public static void main(String[] args) throws Exception {
@LukasKalbertodt
LukasKalbertodt / meta.cpp
Created October 22, 2014 20:33
Template Meta Program to solve the Partial Knapsack Problem (works with clang & gcc)
/**
* --- Template Meta Program to solve the Partial Knapsack Problem ---
*
* This little piece of code solves the partial knapsack problem at compile
* time. This is not useful in any way. I just wanted to discover the
* possibilities of template meta programming.
* Note that this code is absolutly awful. First of all: It's a "pure" template
* meta program, which is ugly on it's own. Furthermore my code is ugly in
* particular. The motivation to clean up super-ugly code to get a little bit
* less ugly code is... not that high.