Skip to content

Instantly share code, notes, and snippets.

@sli
sli / Main.elm
Created August 23, 2018 21:53
Some random, useless Elm shit that I just want to show to people.
import Html exposing (Html, Attribute, text, program, section, div, button, input, label)
import Html.Events exposing (onClick)
import Html.Attributes exposing (class, type_, placeholder)
type alias Todo =
{ id : Int
, description : String
, done : Bool
}
type alias Model = { todos : List Todo }
@sli
sli / solder-install.sh
Created August 15, 2017 23:55
Solder installer.
#!/bin/bash
# Get root if needed
if [ "$EUID" -ne 0 ]
echo This script must be run as root. Enter root password to continue.
sudo su
fi
# Install most things
dnf install vim git nginx mariadb-server mariadb php php-cli php-curl php-mcrypt php-apcu php-fpm
@sli
sli / copypasta.md
Last active January 27, 2017 02:02
copypasta.md
w e w l a d a l w e w
e e e           e e e
w e w l a d a l w e w
l   l l       l l   l
a   a   a   a   a   a
d   d     d     d   d
a   a   a   a   a   a
l   l l       l l   l
w e w l a d a l w e w
@sli
sli / MatricomManual.md
Last active July 3, 2021 22:22
Transcribed manual for Matricom GPad controllers.

Matricom Gamepad

For your enjoyment and safety, we recommend that you read this manual thoroughly before using this product and keep this manual handy for reference if needed.

Characteristics:

  1. Compatible with Android and PC
  2. Wireless
  3. D-Pad and 12 buttons
  4. Dual analog joysticks
@sli
sli / colorhistogram.py
Created December 22, 2016 00:49
Generates a RGB histogram of an image.
import sys
from PIL import Image, ImageDraw
def scale(r, g, b):
return ((r // 10000) * 2,
(g // 10000) * 2,
(b // 10000) * 2)
im = sys.argv[1]
@sli
sli / poolparse.py
Last active December 12, 2016 01:59
A (kinda bad) MarI/O pool parser.
# state pool file format:
#
# generation
# max_fitness
# species count
# for all species:
# top_fitness
# staleness
# genome count
# for all genomes:
@sli
sli / higan-deps.sh
Last active November 29, 2016 02:41
Installs deps for higan.
#!/bin/bash
PS3="Choose your package manager: "
options=("apt" "dnf" "yum" "pacman" "Cancel")
select opt in "${options[@]}"
do
case $opt in
"apt")
echo "installing with apt"
cmd="apt-get install"
pkgs="gcc-4.9 g++-4.9 xorg-dev libudev-dev libao-dev libopenal-dev"
@sli
sli / Color-O-Tron_5000.ino
Last active November 4, 2016 20:56
Color-O-Tron 5000 Lighting System for the Arduino
#include <math.h>
#define DEBUG_BAUD 9600
// def to enable, undef to disable
#define DEBUG
#define TEXT_ONLY
#define UP 1
#define DOWN -1
@sli
sli / lsystem.py
Last active October 26, 2016 00:01
A generic L-System renderer that uses Turtle.
'''
A generic L-System renderer that uses Turtle. Try some of these examples:
Lace: $ python lsystem.py -i 6 -a 30 -x W -r W=+++X--F--ZFX+;X=---W++F++YFW-;Y=+ZFX--F--Z+++;Z=-YFW++F++Y--- -l 5 -s -50,-200,90
Dragon Curve: $ python lsystem.py -i 10 -a 90 -x FX -r X=X+YF;Y=FX-Y
Fractal Plant: $ python lsystem.py -i 6 -a 25 -r X=C0F-[C2[X]+C3X]+C1F[C3+FX]-X;F=FF -l 5 -s -100,-200,65
Koch Snowflake: $ python lsystem.py -i 4 -a 60 -x F++F++F -r F=F-F++F-F -l 5 -s -200,-150,0
Kevs Wispy Tree: $ python lsystem.py -i 5 -a 25 -x FX -r F=C0FF-[C1-F+F]+[C2+F-F];X=C0FF+[C1+F]+[C3-F] -s 0,-200,90 -l 5
Sierpinski Carpet: $ python lsystem.py -i 4 -a 90 -x F -r F=F+F-F-F-G+F+F+F-F;G=GGG -l 5 -s 0,-150,90 -g
Sierpinski Triangle: $ python lsystem.py -i 6 -a 120 -x F-G-G -r F=F-G+F+G-F;G=GG -l 5 -s 100,100,-90 -g
\documentclass[12pt,fleqn,leqno,letterpaper]{article}
\usepackage{hyperref}
\hypersetup{
colorlinks,
urlcolor=blue
}
\author{R. Cody Maden}
\title{Neopixel Installation}
\date{June 19, 2016}
\setlength{\parindent}{0ex}