Skip to content

Instantly share code, notes, and snippets.

View jedevc's full-sized avatar

Justin Chadwell jedevc

View GitHub Profile
import turtle
import time
class LSystem:
def __init__(self, initiator, rules):
self.current = initiator
self.rules = rules
def step(self):
final = []
@jedevc
jedevc / captcha.py
Created January 16, 2016 09:33
A full (enough) implementation of captcha generation.
#!/bin/python2
import pygame
from pygame.locals import *
import sys
import string
import random
@jedevc
jedevc / main.js
Created May 25, 2016 14:04
Subdividing triangles
/*
* Slightly more convenient way of representing a point or width/height.
*/
function Vector(x, y) {
this.x = x
this.y = y
}
/*
* Contains three points of the triangle and various helper functions.
@jedevc
jedevc / generatebackground
Created March 11, 2018 15:59
Generate a background for the cinnamon desktop environment
#!/bin/bash
###
# Simple script to generate a geometric background for the cinnamon desktop
# environment. I have this set up as a startup script, so I get a new wallpaper
# on every startup :)
#
# This script uses rngback, available from https://github.com/jedevc/rngback.
#
@jedevc
jedevc / editor
Created March 12, 2018 11:15
Use your favorite editor anywhere!
#!/bin/bash
###
# Quick and simple script to open an editor and use it to insert text anywhere.
# To use it, simply set up a keybinding using whatever your OS supports.
#
# Author: Justin Chadwell
# License: UNLICENSE
# Dependencies: xdotool, whatever editor you plan to use
@jedevc
jedevc / install.md
Last active January 29, 2019 15:36
Instructions for installing the logicproof package for pandoc

Installing the logicproof package

Note: this guide assumes you are using pandoc. If you are not, then the instructions will still apply, up until the last step.

Go to https://www.ctan.org/tex-archive/macros/latex/contrib/logicproof and download the package as a .zip file and extract into your working directory.

Enter the directory you just extracted and run latex logicproof.ins to generate the latexproof.sty file.

import random
def bubbleDown(li, i, n):
assert i >= 0
assert i < n
left = 2 * i + 1
right = 2 * i + 2
if right < n:
@jedevc
jedevc / README.md
Last active April 13, 2023 15:30
Reproduction environment for containerd docker pusher
  1. Set up the bad registry:
    docker compose up
    
  2. Attempt to push an image to the bad registry:
    ctr --debug image push localhost:80/alpine:latest
    
package main
import (
"fmt"
"sync"
)
func main() {
a := make(chan int, 1)
b := make(chan int, 1)