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
/** | |
This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any | |
means. | |
In jurisdictions that recognize copyright laws, the author or authors | |
of this software dedicate any and all copyright interest in the |
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 <stdint.h> | |
#include <stdbool.h> | |
#include <math.h> | |
// 4th-order polynomial cosine approximation | |
// Derived from | |
// http://web.archive.org/web/20210224233553/https://www.coranac.com/2009/07/sines/ | |
// Changes: | |
// - constants split out into variables | |
// - 32-bits-per-turn angles as input |
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 curses, sys, difflib | |
import time, os.path | |
import watchdog.events, watchdog.observers | |
class Handler(watchdog.events.FileSystemEventHandler): | |
def __init__(self, path): | |
self.path = os.path.abspath(path) | |
self.matcher = difflib.SequenceMatcher(isjunk=lambda s: s.isspace()) | |
self.contents = None | |
self.first = True |
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 dis, inspect, typing | |
import math, sys | |
import os | |
from llvmlite import ir | |
#def putchar(n: int) -> int: pass | |
def fact(n: int) -> int: | |
if n <= 1: return 1 | |
else: return n*fact(n-1) |
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 os, os.path | |
import struct, array, sys, io | |
def readstring(f): | |
return f.read(f.read(1)[0]) | |
class SectionType: | |
NULL = 0 | |
PROGBITS = 1 | |
SYMTAB = 2 |
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 dis, inspect, typing | |
import math, sys | |
from operator import or_ | |
from functools import reduce | |
#def putchar(n: int) -> int: pass | |
def fact(n: int) -> int: | |
if n <= 1: return 1 | |
else: return n*fact(n-1) |
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
# https://github.com/dariusk/corpora/blob/master/data/words/strange_words.json | |
cubersome | |
dingleberry | |
doodlesack | |
expat | |
flabergasted | |
floccinaucinihilipilification | |
jentacular | |
kardashian | |
macrosmatic |
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 xml.dom import minidom | |
import sys | |
from xml.sax.saxutils import quoteattr, escape | |
import math, numpy | |
class Scanner: | |
def __init__(self, data): | |
self.data = data | |
self.pos = 0 | |
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
#!/usr/bin/env python3 | |
from mastodon import Mastodon | |
from bs4 import BeautifulSoup | |
import urllib | |
myinstance = "somewhere.social" | |
m = Mastodon(client_id="…", client_secret="…", access_token="…", api_base_url="https://"+myinstance) | |
myid = m.account_verify_credentials()['id'] | |
admins = {} |
NewerOlder