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
class CursedInt: | |
def __init__(self, expr): | |
self.__expr = str(expr) | |
# "Not exactly like numbers" | |
# Most other functions depend on this function being available, since | |
# CursedInt should behave like int in most cases. | |
def __int__(self): | |
return eval(self.__expr) |
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
#let proof( | |
name: none, | |
line: line(length: 100%), | |
above, | |
below, | |
elem_padding: 1.5em, | |
line_padding: .3em, | |
name_padding: .4em, | |
) = style(styles => { | |
// Make reassignable |
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 | |
# A small script to collect the xkcd countdown frames from munvoseli's | |
# xkcd-countdown page or from explainxkcd and render them as a video. | |
# Requires beautifulsoup4 and requests | |
# Requires ffmpeg to be installed | |
import argparse | |
from pathlib import Path |
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
% Brainfuck interpreter written in PostScript. | |
% | |
% Written in about 2 to 3 hours around midnight. This includes the time spent | |
% learning PostScript, which is now the first stack-based programming language | |
% I've actually used. Because of this, the code is pretty ugly (even for | |
% PostScript), but hey, it manages to correctly interpret the "Hello world" | |
% example from the Wikipedia page on Brainfuck. | |
% | |
% For best results, run via `ghostscript brainfuck.ps`. Enter your brainfuck | |
% code at the `brainfuck> ` prompt and your program input (if necessary) at 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
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
module AddBytes where | |
import Control.Monad.Trans.State | |
data Bit = O | I | |
deriving (Show, Eq, Ord) | |
type Carry = Bit |
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
extends TextureRect | |
export var sensitivity: Vector3 = Vector3(0.005, 0.005, TAU/4) | |
var euler: Vector3 = Vector3.ZERO | |
func _init() -> void: | |
sensitivity.x *= -1 | |
func _input(event: InputEvent) -> void: | |
if event.is_action_pressed("ui_cancel"): |
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
{-# LANGUAGE OverloadedStrings #-} | |
module Haboli.Euphoria.WegaBorad where | |
import Control.Monad | |
import Control.Monad.Trans.Class | |
import Control.Monad.Trans.State | |
import Data.Char | |
import Data.Foldable | |
import Data.List |
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
Calculate bunny like so: | |
f(t) = \sum_{n=1}^{\infty} \left( c(n) e^{i n t} + c(-n) e^{- i n t} \right) | |
{n, c(n), c(-n)} | |
{1, 85.2475 - 169.755 I, 28.0975 - 9.90891 I} | |
{2, 6.29048 - 2.67816 I, -0.746606 + 22.7351 I} | |
{3, -26.7847 - 11.3627 I, -6.43327 - 2.05265 I} | |
{4, 4.23445 + 7.35356 I, 10.1179 + 4.58626 I} | |
{5, -6.41438 - 7.65797 I, -6.39548 - 11.585 I} | |
{6, -7.0104 - 0.501367 I, -3.28289 - 4.8017 I} |
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
extends Camera | |
""" | |
Space/Enter - capture cursor | |
Escape - free cursor | |
WASDQE - move | |
Shift - fast movement | |
Ctrl - slow movement | |
""" |
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 | |
import argparse | |
import re | |
import subprocess | |
def parse_args(): | |
parser = argparse.ArgumentParser() | |
parser.add_argument( | |
"output_file", |
NewerOlder