Skip to content

Instantly share code, notes, and snippets.

View 3cky's full-sized avatar
💭
I may be slow to respond.

Victor Antonovich 3cky

💭
I may be slow to respond.
View GitHub Profile
function _draw()
cls(8)
srand(5)
-- Iterate every 8 square pixels of the screen.
-- The `.5` is to make sure the points are at the center of each pixel.
-- We'll draw one wall of the maze in each square.
for y=.5,129,8 do
for x=.5,129,8 do
-- Progress in the rotation cycle. One rotation is [0..1]
@schlomo
schlomo / grab.sh
Created April 20, 2020 17:31
video grabber script for PAL VHS video
#!/bin/bash
#
# record from video grabber
VIDEO=${VIDEO:-/dev/video1}
AUDIO=${AUDIO:-hw:1}
AUDIO_RATE=48000
VIDEO_IN="-f video4linux2 -video_size 720x576 -thread_queue_size 1024 -framerate 25 -i $VIDEO -vsync 1"
AUDIO_IN="-f alsa -sample_rate $AUDIO_RATE -channels 2 -thread_queue_size 2048 -itsoffset 0.3 -i $AUDIO"
@bgadrian
bgadrian / set.go
Last active April 23, 2024 13:50
How to implement a simple set data structure in golang
type Set struct {
list map[int]struct{} //empty structs occupy 0 memory
}
func (s *Set) Has(v int) bool {
_, ok := s.list[v]
return ok
}
@cyclingengineer
cyclingengineer / README
Last active December 31, 2019 10:46
OpenHAB Heating Control Rules
OpenHAB Heating Example
========================
This heating example shows three rooms in my house with 1 radiator valve, 1 temperature sensor per room and a single boiler. It could be adapted for different situations.
The rules allow for simple addition of items in rooms as long as they follow the naming convention and have at least a valve, a thermometer, setpoint and a demand switch.
The demand switch is purely internal and is used to indicate if the room requires heat or not. All rooms are OR'd together to define the boiler status and each room demand (On/Off) is applied to the radiator valves.
It could be more generic for multiple thermometers/valves per room - but it suits my needs for now. If I make it more generic I will update it accordingly.