Skip to content

Instantly share code, notes, and snippets.

View v4lli's full-sized avatar
❄️

Valentin v4lli

❄️
  • Munich
View GitHub Profile
@v4lli
v4lli / fit_star_widget.js
Last active September 7, 2021 22:12
Scriptable.app Fit Star Capacity Status Widget Fork
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: yellow; icon-glyph: star;
// copied & adapted from: https://gist.github.com/kevinkub/46caebfebc7e26be63403a7f0587f664
class LineChart {
constructor(width, height, values, ymin, ymax, len, padding = 0) {
this.ctx = new DrawContext()
this.ctx.size = new Size(width, height)
this.values = values;
@v4lli
v4lli / meteocool_client.py
Created May 5, 2021 21:11
Retrieve the currently forecasted rain intensities from the meteocool API. Retunred valued are RVP6 values
#!/usr/bin/env python3
import requests
# quick & dirty script, plz don't judge
def get_intensity(meteo_object: object):
if "reported_intensity" in meteo_object:
return meteo_object["reported_intensity"]
def get_intensity_str(meteo_object: object):
@v4lli
v4lli / proxy.go
Last active November 12, 2017 12:46
// toy http "proxy" (not adhereing the proxy protocol,
// only a pre-configured static host), first go programm.
// replaces some words with l33t alternative and replaces
// all <img> tags.
// call with './proxy www.mmix.cs.hm.edu'; only works for
// http sites, no https.
// known issues:
// - not a real proxy
// - not valid http
@v4lli
v4lli / tiasm.py
Created October 27, 2017 21:28
Simple assembler to generate bytecode from asm text instructions for a custom-built microprocessor
#!/usr/bin/env python3
#
# Valentin Dornauer <valentin@unimplemented.org>
# Sun Dec 11 22:11:27 CET 2016
#
# Simple assembler to generate bytecode from asm
# text instructions for a custom-built microprocessor.
#
# Usage: tiasm.py <input_file>
@v4lli
v4lli / fish.cpp
Created October 10, 2017 08:28
ZNC Fish Module with OpenSSL 1.1 patches (10/10/2017)
#include "znc/main.h"
#include "znc/User.h"
#include "znc/Nick.h"
#include "znc/Modules.h"
#include "znc/Chan.h"
#include "znc/IRCNetwork.h"
#include <string.h>
using std::pair;
using std::map;