Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Linus glatteis

🏠
Working from home
  • Germany
View GitHub Profile
View pl.py
import argparse
import re
from fractions import Fraction
parser = argparse.ArgumentParser(description='Generate a tikz graph from a Parameter Lifting input file (coming out of storm, with two variables).')
parser.add_argument('--file', type=str, help='the input file')
args = parser.parse_args()
content = None
with open(args.file, 'r') as f:
View aconnect.c
#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);
}
View tree.tex
\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$}
View word_clock.c
#include <FastLED.h>
#include <RTClib.h>
#include <Wire.h>
#include "RTClib.h"
#define NUM_LEDS 114
#define DATA_PIN 5
View data.txt
[('de_IAmA', 1.3515846220866914), ('AMA', 2.564565943238731), ('IWantToLearn', 2.7245425434583717), ('HomeImprovement', 3.0591305000750864), ('AskWomen', 3.703256917483207), ('AskReddit', 3.8497102437361512), ('CFB', 4.442814079861581), ('announcements', 4.490258077819533), ('baseball', 4.544408051759211), ('reddit.com', 4.63847624650684), ('financialindependence', 4.77807954336218), ('relationship_advice', 4.881641667725944), ('changemyview', 5.127923057581091), ('SubredditDrama', 5.31451951043458), ('Entrepreneur', 5.4086792155627315), ('beermoney', 5.44439668646452), ('TheRedPill', 5.610672124904799), ('pokemon', 5.658614049206714), ('Twitch', 5.860265669331958), ('netsec', 5.873634528615531), ('nfl', 6.1896287775006735), ('PublicFreakout', 6.217061645260257), ('DotA2', 6.4053854914411925), ('startups', 6.62640931372549), ('electronicmusic', 6.836680469289165), ('TheSilphRoad', 7.1439020810228975), ('asoiaf', 7.159901613001031), ('JusticePorn', 7.178302100649842), ('SquaredCircle', 7.430796586059744), ('hi
View plot.py
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))
View get.py
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):
View xea.py
# 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]
View generate_clock.py
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")