Skip to content

Instantly share code, notes, and snippets.

View codl's full-sized avatar
🎧
Now Playing: They Might Be Giants - Nothing's Gonna Change My Clothes

codl codl

🎧
Now Playing: They Might Be Giants - Nothing's Gonna Change My Clothes
View GitHub Profile

codl's ______ of the year 2016

Everyone loves lists. I made some lists of things I enjoyed throughout 2016. These aren't necessarily things that have come out in 2016.

Albums

  • Lemon Demon - [Spirit Phone][]
  • IGLOOGHOST - [Little Grids][]
03000000022000000090000011010000,8Bitdo NES30 Pro 8Bitdo NES30 Pro,a:b0,b:b1,y:b4,x:b3,start:b11,back:b10,leftstick:b13,rightstick:b14,leftshoulder:b8,rightshoulder:b9,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,
@codl
codl / cave.py
Last active February 10, 2019 00:01
"""
cave.py
this thing will tell you where to go to solve the infamous volcanic cave maze
in kingdom of loathing's "Me and My Nemesis" quest
it only has support for one of the layouts because i keep getting that one
if you need another layout you can either edit this scrips or just use the maps on kolwiki and leave me alone.
i will add support for more layouts as i encounter them
@codl
codl / _.markdown
Last active April 11, 2017 20:35
whoops lol

honk

@codl
codl / a.markdown
Last active April 12, 2017 18:47

Federation 101, or Why The Federated Timeline Isn't The Same Everywhere

You've probably noticed that the fediverse is made up of hundreds of loosely connected instances. These instances don't share every single message to every other instance, that would be unsustainable and each one would end up with a copy of the whole network. (bitcoin joke here) Each instance only needs to know about some users, and some posts.

Let's set up a scenario, you run an instance A, with a user: u1. There are other instances and users, we'll think about them soon. So, which messages does your instance know about?

  • First, messages from your users, unsurprisingly, are known to your instance
  • Second, if a user, say u1@A, follows someone on another server, say u2@B, A will ask B to notify it whenever u2 posts. Any posts from u2 from that point forward will be known to A. Note how this isn't retroactive, your server won't go and download their old posts!
  • Third, if a remote user, say u3@C mentions one of your users: "@u1@A h
let pico8_gpio = Array(128);
(() => {
let clock_start = Date.now();
function update_clock(){
let t = Date.now() - clock_start;
for(let i = 0; i < 6; i++){
pico8_gpio[i] = Math.floor(((t / 100) % Math.pow(256, i+1)) / Math.pow(256, i))
}
requestAnimationFrame(update_clock);
}
from threading import Thread
from functools import wraps
def background(fun):
@wraps(fun)
def wrapper(*args, **kwargs):
Thread(target=fun, args=args, kwargs=kwargs).start()
return wrapper
#!/bin/bash
set -eufo pipefail
SIZE=0
F=$(mktemp --tmpdir b2-bucket-size.json.XXXX)
b2 list-file-versions $1 > $F
while true; do
SIZE=$[$SIZE + $(jq -r '[.files[].contentLength] | add' $F)]
According to all known laws
of aviation,
there is no way a bee
should be able to fly.
Its wings are too small to get
its fat little body off the ground.
The bee, of course, flies anyway
["According to all known laws of aviation, there is no way a bee should be able to fly.",
"Its wings are too small to get its fat little body off the ground.",
"The bee, of course, flies anyway because bees don't care what humans think is impossible.",
"Yellow, black.",
"Yellow, black.",
"Yellow, black.",
"Yellow, black.",
"Ooh, black and yellow!",
"Let's shake it up a little.",
"Barry!",