Skip to content

Instantly share code, notes, and snippets.

Jesse Maes kebertx

Block or report user

Report or block kebertx

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View termite.js
function mod(a, b) {
return (+a % (b = +b) + b) % b;
}
function hex(n) {
return (n % 0x100).toString(16).padStart(2, "0");
}
function color(r, g, b) {
return "#" + hex(r) + hex(g) + hex(b);
@kebertx
kebertx / example.py
Created Feb 3, 2018
half assed code golf
View example.py
import sys, cairo, math, random
sd=int(sys.argv[1]) if len(sys.argv)>1 else random.randrange(1<<64-1)
rng=random.Random(sd); print(sd)
rnd=rng.random; pick=rng.choice; norm=rng.normalvariate
s=cairo.ImageSurface(cairo.FORMAT_ARGB32, 820, 1420)
c=cairo.Context(s); c.scale(820, 1420)
c.set_source_rgb(.1*rnd(),.1*rnd(),.1*rnd()); c.paint()
@kebertx
kebertx / Art.ipynb
Last active Nov 5, 2018
ACM Procedural Art
View Art.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View etymology.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kebertx
kebertx / dictproxy.py
Last active Jul 1, 2017
Flowsnake Turmites
View dictproxy.py
class DictProxy(dict):
'''DictProxy(keys, values) -> DictProxy
Compose two mappings. When looking up an item, use the given key to get an
intermediate key from `keys`, then use that key to lookup a value from
`values`
'''
def __init__(self, keys, values):
View Ocr.hs
import Data.List
import Control.Monad
import System.IO (isEOF)
import qualified Data.Map as Map
translate :: String -> String
translate rune = Map.findWithDefault "?" rune dictionary
where dictionary = Map.fromList [
(" _ | ||_|", "0")
View seven.py
import cairo
import itertools
import math
import random
import subprocess
from PIL import Image
WIDTH, HEIGHT = 420, 420
def point_on_circle(radius=1, center=(0, 0), angle=None):
View lightning.py
import cairo
import math
import random
import subprocess
from doodle import point_on_square
WIDTH, HEIGHT = 580, 580
phi = (math.sqrt(5) - 1) / 2
def distance(a, b):
@kebertx
kebertx / doodle.py
Created Apr 4, 2017
playing with python-cairo
View doodle.py
#!/usr/bin/env python
import cairo
import math
import random
import subprocess
WIDTH, HEIGHT = 580, 580
def point_on_square(length=1, corner=(0, 0), angle=None):
@kebertx
kebertx / keybase.md
Created Sep 17, 2016
Verifying myself
View keybase.md

Keybase proof

I hereby claim:

  • I am kebertx on github.
  • I am kebertx (https://keybase.io/kebertx) on keybase.
  • I have a public key ASAqSIjmPY86sbj4n9SEEwCM7tG8QrfUQYu6UEH-t4Q9BQo

To claim this, I am signing this object:

You can’t perform that action at this time.