Skip to content

Instantly share code, notes, and snippets.

View yamatt's full-sized avatar

Matt Copperwaite yamatt

View GitHub Profile
@yamatt
yamatt / split.css
Last active September 25, 2021 14:11 — forked from jpnelson/split.css
Responsive, resizable panel layout with flexbox JUST CSS
* {
box-sizing: border-box;
}
html, body {
height: 100%;
padding: 0;
margin: 0;
}
#!/usr/bin/env python
import pyglet
mp3 = "test.mp3"
source = pyglet.media.load(mp3)
player = pyglet.media.Player()
player.queue(source)
player.play()
@yamatt
yamatt / bijective.py
Created October 24, 2011 10:21 — forked from zumbojo/bijective.rb
Simple bijective function (base(n) encode/decode) in Python
# Simple bijective function
# Basically encodes any integer into a base(n) string,
# where n is ALPHABET.length.
# Based on pseudocode from http://stackoverflow.com/questions/742013/how-to-code-a-url-shortener/742047#742047
ALPHABET = list("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
# make your own alphabet using:
# (('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a).shuffle.join
def bijective_encode(i):