Skip to content

Instantly share code, notes, and snippets.

View a.py
import pyglet
class AWindow(pyglet.window.Window):
def __init__(self):
super(AWindow, self).__init__(100, 100)
self.batch = pyglet.graphics.Batch()
self.circle = pyglet.shapes.Circle(
View a.py
import pyglet
class AWindow(pyglet.window.Window):
def __init__(self):
super(AWindow, self).__init__(100, 100)
self.batch = pyglet.graphics.Batch()
self.circle = pyglet.shapes.Circle(
View a.py
import pyglet
window = pyglet.window.Window()
batch = pyglet.graphics.Batch()
label = pyglet.text.Label(
"Hello, world",
font_name="Times New Roman",
font_size=36,
x=window.width // 2,
y=window.height // 2,
View breakout.py
#!/usr/bin/env python
from enum import Enum
import math
import pyglet
from pyglet import event
from pyglet import shapes
from pyglet.window import key
# * lose game when ball hits bottom
# * change angle when it hits the paddle
View move.py
#!/usr/bin/env python
import math
import pyglet
from pyglet import shapes
WIDTH = 960
HEIGHT = 960
MARGIN = 100
View ball.py
#!/usr/bin/env python
import pyglet
from pyglet import shapes
WIDTH = 960
HEIGHT = 540
RED = (255, 0, 0)
window = pyglet.window.Window(WIDTH, HEIGHT)
@llimllib
llimllib / padcolors.py
Last active Jul 28, 2020
Setting pad colors on the Novation LaunchKey Mini MK3
View padcolors.py
# This file demonstrates how to use midi codes to control the color of the
# keypads on a Novation LaunchKey mini; There is no official documentation of
# it as far as I can tell
#
# the LaunchKey MK2 Programmer's guide is useful, though not accurate to
# details on the MK3 mini:
# https://customer.novationmusic.com/sites/customer/files/novation/downloads/10535/launchkey-mk2-programmers-reference-guide.pdf
import random
import time
@llimllib
llimllib / volume.lua
Last active Jul 7, 2020
A script to use the first knob on my novation keyboard to control my mac's volume
View volume.lua
-- This is a hammerspoon (http://www.hammerspoon.org/) script to hook the
-- volume knob on my keyboard up to my system's volume control
-- https://easings.net/ is great for easing functions
-- I tried easeInExpo, but it was too sharp (return 2 ^ (10 * x - 10))
-- experimentation suggested cubic was the most pleasant. Linear was expectedly
-- awful
function easeIn(x)
return x * x * x
end
View installvoid.sh
# https://voidlinux.org/usage/xbps/ is a handy site for docs that isn't linked
# from the docs page, for whatever reason. Gives good xbps-* examples
# install non-free repository:
sudo xbps-install void-repo-nonfree
# update the system; all installs failed before this:
sudo xbps-install -Su
# xbps is hard to type. Add these aliases to your bashrc if xbps-install is
View Minnesota murder.md

609.185 MURDER IN THE FIRST DEGREE.

(a) Whoever does any of the following is guilty of murder in the first degree and shall be sentenced to imprisonment for life:

(1) causes the death of a human being with premeditation and with intent to effect the death of the person or of another;

(2) causes the death of a human being while committing or attempting to commit criminal sexual conduct in the first or second degree with force or violence, either upon or affecting the person or another;

(3) causes the death of a human being with intent to effect the death of the person or another, while committing or attempting to commit burglary, aggravated robbery, kidnapping, arson in the first or second degree, a drive-by shooting, tampering with a witness in the first degree, escape from custody, or any felony violation of chapter 152 involving the unlawful sale of a controlled substance;

You can’t perform that action at this time.