Skip to content

Instantly share code, notes, and snippets.

View leonrinkel's full-sized avatar

Leon Rinkel leonrinkel

View GitHub Profile
# All resources definition must be declared
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
name: ingressroutes.traefik.containo.us
---
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: psp.flannel.unprivileged
annotations:
seccomp.security.alpha.kubernetes.io/allowedProfileNames: docker/default
seccomp.security.alpha.kubernetes.io/defaultProfileName: docker/default
apparmor.security.beta.kubernetes.io/allowedProfileNames: runtime/default
apparmor.security.beta.kubernetes.io/defaultProfileName: runtime/default
@leonrinkel
leonrinkel / bcd_to_seven_segment_decoder.v
Created October 10, 2021 10:36
Verilog BCD to Seven Segment Decoder
module bcd_to_seven_segment_decoder(
input [3:0] in,
output reg a, b, c, d, e, f, g
);
always @(in) begin
case (in)
0: assign {a, b, c, d, e, f, g} = 7'b1111110;
1: assign {a, b, c, d, e, f, g} = 7'b0110000;
2: assign {a, b, c, d, e, f, g} = 7'b1101101;
3: assign {a, b, c, d, e, f, g} = 7'b1111001;
@leonrinkel
leonrinkel / traffic-light.ts
Created June 13, 2021 13:30
Typescript State Machine
interface TrafficLightOperations {
onButtonPressed(): void;
onWaitedToTurnGreen(): void;
waitToTurnRed(): void;
onWaitedToTurnRed(): void;
}
interface TrafficLightContext {
activeLight?: "red" | "green";
}
@leonrinkel
leonrinkel / gist:5a5ce462c752c6215bf28fb2ffe486ec
Last active May 22, 2021 20:23
raspberry pi linux waveshare oled fan hat
mount sd cards boot partition
remove console=tty1 from boot/cmdline.txt
add modules_load=pwm_pca9685 to boot/cmdline.txt
add dtoverlay=ssd1306,address=0x3c,width=128,height=32,inverted,sequential to boot/firmware/config.txt
add dtoverlay=i2c-pwm-pca9685a,addr=0x40 to boot/firmware/config.txt
# or
$ echo "dtoverlay=ssd1306,address=0x3c,width=128,height=32,inverted,sequential" | sudo tee -a /boot/firmware/config.txt
$ echo "dtoverlay=i2c-pwm-pca9685a,addr=0x40" | sudo tee -a /boot/firmware/config.txt