Skip to content

Instantly share code, notes, and snippets.

@wonderb0lt
wonderb0lt / dots.py
Created February 2, 2022 16:15
Work at Dynatrace in Vienna, then you'll know ;)
import string
def read_single(chars = 0):
input_sequence = input(f'> ')
char = chr(int(input_sequence, base=2))
if char in string.printable:
return char
else:
@wonderb0lt
wonderb0lt / terraform.json
Last active January 21, 2022 10:00
A less bad terraform var snippet
{
"Empty Variable (wonderb0lt)": {
"prefix": "varx",
"body": [
"variable \"${1:name}\" {",
"\ttype = ${2|string,number,bool,set(string)|}",
"\t${3:description = \"${4:(optional) describe your variable}\"}",
"\t${5:default = \"${6:default_value}\"}",
"}"
]
@wonderb0lt
wonderb0lt / file.py
Last active December 16, 2021 21:21
Fun with subnet fragmentation
from sys import argv
from ipaddress import IPv4Network
class SubnetUsage:
def __init__(self, subnet_cidr):
self.subnet_cidr = subnet_cidr
self.network = IPv4Network(subnet_cidr)
self.used = []
def mark(self, ip_or_cidr):
self.used.append(IPv4Network(ip_or_cidr))

Keybase proof

I hereby claim:

  • I am wonderb0lt on github.
  • I am wonderb0lt (https://keybase.io/wonderb0lt) on keybase.
  • I have a public key ASBL8xwSHhOo3sjoxc_-18K0Cpl626V1kN4W28DJ0Hfd5Qo

To claim this, I am signing this object:

@wonderb0lt
wonderb0lt / Main.java
Last active April 11, 2019 12:05
Some samples from an internal Zühlke presentation about JSR-354 and the new Date API
import org.javamoney.moneta.FastMoney;
import org.javamoney.moneta.Money;
import org.javamoney.moneta.format.CurrencyStyle;
import javax.money.*;
import javax.money.convert.CurrencyConversion;
import javax.money.convert.MonetaryConversions;
import javax.money.format.AmountFormatQuery;
import javax.money.format.AmountFormatQueryBuilder;
import javax.money.format.MonetaryAmountFormat;
@wonderb0lt
wonderb0lt / logger.js
Created January 25, 2017 13:23
Relative timestamps in winston
import winston from 'winston';
import {LOG_PATH} from './env';
let lastLog = new Date();
/**
* @type {winston.Logger}
*/
export default new winston.Logger({
transports: [
new winston.transports.Console({
public class Main {
static String jsonString = "{\n" +
"\t\"1002001\": {\n" +
"\t\t\"level\": 2,\n" +
"\t\t\"name\": \"CaptKrunch\",\n" +
"\t\t\"uid\": 1002001,\n" +
"\t\t\"user\": {\n" +
"\t\t\t\"age\": 21,\n" +
"\t\t\t\"chat_color\": \"CC3299\",\n" +
"\t\t\t\"city\": \"None\",\n" +
public class Yep {
static String jsonString = "{\n" +
"\t\"1002001\": {\n" +
"\t\t\"level\": 2,\n" +
"\t\t\"name\": \"CaptKrunch\",\n" +
"\t\t\"uid\": 1002001,\n" +
"\t\t\"user\": {\n" +
"\t\t\t\"age\": 21,\n" +
"\t\t\t\"chat_color\": \"CC3299\",\n" +
"\t\t\t\"city\": \"None\",\n" +
public class Yep {
static String jsonString = "{\n" +
"\t\"1002001\": {\n" +
"\t\t\"level\": 2,\n" +
"\t\t\"name\": \"CaptKrunch\",\n" +
"\t\t\"uid\": 1002001,\n" +
"\t\t\"user\": {\n" +
"\t\t\t\"age\": 21,\n" +
"\t\t\t\"chat_color\": \"CC3299\",\n" +
"\t\t\t\"city\": \"None\",\n" +
@wonderb0lt
wonderb0lt / WordWorth.java
Created February 11, 2016 12:38
Something that came up in Java::chat
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import static java.util.stream.Collectors.toList;
public class Main {
public static void main(String[] args) throws IOException {