This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !!!!!! | |
# better version by jan: | |
# https://github.com/janerjak/region-diagram-generator | |
# !!!!!! | |
import argparse | |
import re | |
from fractions import Fraction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\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$} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <FastLED.h> | |
#include <RTClib.h> | |
#include <Wire.h> | |
#include "RTClib.h" | |
#define NUM_LEDS 114 | |
#define DATA_PIN 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |