Skip to content

Instantly share code, notes, and snippets.

View glatteis's full-sized avatar
🚃
Working from railway

Linus glatteis

🚃
Working from railway
  • Germany
View GitHub Profile
from PIL import Image, ImageDraw, ImageFilter, ImageFont
from math import sin, cos, pi
LEN_HOUR = 150
LEN_MINUTE = 250
font = ImageFont.truetype("helvetica.ttf", 25)
title = Image.open("title.png")
@glatteis
glatteis / xea.py
Last active February 14, 2018 14:31
# usage: python xea.py <num1> <num2>
from sys import argv
pa, pb = int(argv[1]), int(argv[2])
a, b = pa, pb
mods = [a, b]
import json
import urllib.request
def get_ratio(subreddit):
url = "https://www.reddit.com/r/" + subreddit + "/top/.json?sort=top&t=all&from="
total_upvotes = 0
total_comments = 0
for i in range(0, 200, 25):
import matplotlib.pyplot as plt
img_name = 'plot.png'
data_s = open("data.txt").read()
data = eval(data_s)
data = data[:-2]
names = [x[0] for x in data]
heights = [x[1] for x in data]
coords = range(len(data))
#include <FastLED.h>
#include <RTClib.h>
#include <Wire.h>
#include "RTClib.h"
#define NUM_LEDS 114
#define DATA_PIN 5
\def \tbleaf #1#2%
{
\begin{TAB}(r,1cm,1cm)[5pt]{|c|}{|c|c|}% (rows,min,max)[tabcolsep]{columns}{rows}
#1 \\
#2
\end{TAB}
}
\scalebox{0.8}{
\begin{forest}
[ \tbleaf{$T(n)$}{$n$}
@glatteis
glatteis / aconnect.c
Last active September 21, 2018 08:57
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
const char* POST_TO = /* local IP of router here */;
// Sensitive data omitted
const char* POST_REQUEST = "ACT=LOGI%40LTYP=1%40MAC=%40IP=%40ERV=%40URL=%40PUB=1%40MEDM=0%40USR=%40PASS=";
void setup() {
Serial.begin(115200);
}
@glatteis
glatteis / pl.py
Last active August 25, 2022 15:11
# !!!!!!
# better version by jan:
# https://github.com/janerjak/region-diagram-generator
# !!!!!!
import argparse
import re
from fractions import Fraction