This file contains hidden or 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 math, cmath | |
import pygame | |
class Circle: | |
def __init__(self, x, y, curvature): | |
self.center = complex(x, y) | |
self.curvature = curvature | |
self.radius = abs(1 / curvature) | |
def descartes_theorem(k1, k2, k3): |
This file contains hidden or 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 cv2 | |
import numpy as np | |
import random | |
class SVG: | |
def __init__(self, width, height): | |
self.width = width | |
self.height = height | |
self.elements = [] |
This file contains hidden or 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
""" | |
A tiny youtube video downloader. | |
usage: yt.py [-h] [--only-audio] [--num_retries NUM_RETRIES] [--output OUTPUT] video_url | |
Inspried by this blog post: https://tyrrrz.me/blog/reverse-engineering-youtube-revisited | |
Note that the get_video_info function will be subject to change when Youtube changes their api. | |
Also note that ffmpeg and ffmpeg-python are required dependencies. | |
""" | |
import argparse |
This file contains hidden or 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
/* Tinytest -- a tiny testing library under the MIT liscense. | |
* Should compile with std=c++17 | |
* Example usage: | |
``` | |
#include "tinytest.h" | |
int main() { | |
Tinytest::test("Test example", [](){ | |
const char *a = "hello"; | |
const char *b = "hello"; |
This file contains hidden or 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 <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
// K[0] to K[63] are initialized as the first 32 bits of the fractional | |
// parts of the cube roots of the first 64 primes | |
const uint32_t k[64] = { | |
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, | |
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, |