Skip to content

Instantly share code, notes, and snippets.

@slaiyer
slaiyer / static.py
Created June 26, 2021 15:43
Yeelight color setter
#!/usr/bin/env python3
"""Yeelight color setter."""
import argparse as arg
import functools as func
import pathlib as path
import sys
import yeelight as y
@slaiyer
slaiyer / swtich.py
Created June 19, 2021 04:03
Yeelight bulb switch
#!/usr/bin/env python3
"""Switch Yeelight bulb on or off."""
import argparse as arg
import enum
import functools as func
import pathlib as path
import sys
@slaiyer
slaiyer / blend.py
Last active June 26, 2021 15:42
Yeelight flow controller
#!/usr/bin/env python3
"""Yeelight flow controller."""
import argparse as arg
import functools as func
import pathlib as path
import sys
from typing import Sequence
@slaiyer
slaiyer / tauler.py
Created May 7, 2021 00:00
Euler's identity, but with tau
#!/usr/bin/env python3
import math
import numpy
from turtle import *
def tauler(unit):
tau = math.pi * 2
d_r_90 = tau / 4
@slaiyer
slaiyer / euler.py
Created May 6, 2021 23:47
Euler's identity
#!/usr/bin/env python3
import math
import numpy
from turtle import *
def euler(unit):
d_r_90 = math.pi / 2
arc_length = math.pi * unit
@slaiyer
slaiyer / hilbert.py
Created May 6, 2021 17:21
Hilbert curve
#!/usr/bin/env python3
import argparse
from turtle import *
def hilbert_curve(step, parity, n):
if n < 1:
return
@slaiyer
slaiyer / validate-jenkins-pipeline.sh
Created March 9, 2021 20:01
Jenkins pipeline validator
# Get JENKINS_SESSION_COOKIE='JSESSIONID.[...]=[...]' from browser cookie jar for $JENKINS_URL while logged in
# This is in lieu of $JENKINS_URL/crumbIssuer/api/json?pretty=true not being usable
curl \
-H "cookie: $JENKINS_SESSION_COOKIE" \
-F "jenkinsfile=<$JENKINSFILE_PATH" \
$JENKINS_URL/pipeline-model-converter/validate
@slaiyer
slaiyer / dvd.html
Created December 29, 2020 10:41
HTML programming
<html>
<head>
<title>S04E05</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
background: black;
}
</style>
@slaiyer
slaiyer / .bash_profile
Created December 2, 2018 13:25
Bash PS1
export PS1='\n$([[ $(jobs | wc -l) -gt 0 ]] && printf '\''<\j> '\'')[\e[1m\u\e[0m] \w\n \[\e[1m\]\$\[\e[0m\] '

Keybase proof

I hereby claim:

  • I am Slaiyer on github.
  • I am slaiyer (https://keybase.io/slaiyer) on keybase.
  • I have a public key whose fingerprint is E286 C33B 5E5C 6285 1323 2589 5490 BBD9 E4CA 8501

To claim this, I am signing this object: