Skip to content

Instantly share code, notes, and snippets.

@RyanScottLewis
RyanScottLewis / cycling_slicer.rb
Created September 4, 2019 07:51
Extend Ruby Enumerable with `#each_cycling_slice`, which cycles though the given list of slice sizes/widths.
class CyclingSlicer
def initialize(slices)
@slices = slices.cycle
@slice = @slices.next
@counter = 0
end
def slice?
@counter += 1
// vim:ft=java
// Lissajous curve
//
// xF yF
// Mouse: 2.18, 2.72
// Owl: 5.14, 2.93
float xF = 1; // X angle factor
float xA = 0; // X modulator angle
APC : 001,036,0861
DATE : 2018-06-13 16:25:29 -0400
HOSTNAME : RyMac
VERSION : 3.14.14 (31 May 2016) unknown
UPSNAME : RyMac
CABLE : USB Cable
DRIVER : USB UPS Driver
UPSMODE : Stand Alone
STARTTIME: 2018-06-11 00:26:04 -0400
MODEL : Back-UPS ES 750G
@RyanScottLewis
RyanScottLewis / install-arch-linux-rpi-zero-w.sh
Created January 10, 2018 09:36 — forked from pklaus/install-arch-linux-rpi-zero-w.sh
Install Arch Linux ARM for Raspberry Pi Zero W on SD Card (with commands to configure WiFi before first boot).
#!/bin/sh -exu
dev=$1
cd $(mktemp -d)
function umountboot {
umount boot || true
umount root || true
}
# RPi1/Zero (armv6h):
mkdir -p build/avr-attiny85
mkdir -p build/avr-attiny85/lib/vusb/usbdrv
mkdir -p build/avr-attiny85/src/library
avr-gcc -c -Os -Wall -DF_CPU=16000000 -mmcu=attiny85 -MMD -ffunction-sections -fdata-sections -I 'include' -Wall -o 'build/avr-attiny85/src/library/tdled.o' 'src/library/tdled.c'
avr-ar rcs 'build/avr-attiny85/libtdled.a' 'build/avr-attiny85/src/library/tdled.o'
avr-gcc -c -Os -Wall -DF_CPU=16000000 -mmcu=attiny85 -MMD -ffunction-sections -fdata-sections -I 'include' -I 'lib' -I 'src/firmware' -Wall -o 'build/avr-attiny85/lib/vusb/usbdrv/usbdrv.o' 'lib/vusb/usbdrv/usbdrv.c'
avr-gcc -c -Os -Wall -DF_CPU=16000000 -mmcu=attiny85 -MMD -ffunction-sections -fdata-sections -I 'include' -I 'lib' -I 'src/firmware' -Wall -o 'build/avr-attiny85/lib/vusb/usbdrv/usbdrvasm.o' 'lib/vusb/usbdrv/usbdrvasm.S'
mkdir -p build/avr-attiny85/src/firmware
avr-gcc -c -Os -Wall -DF_CPU=16000000 -mmcu=attiny85 -MMD -ffunction-sections -fdata-sections -I 'include' -I 'lib' -I 'src/firmware' -Wall -o 'build/avr-attiny85/src/fir
[Unit]
Description=My Python Bot
[Service]
ExecStart=/usr/local/bin/my-python-bot
[Install]
WantedBy=default.target
require "hoop"
include Hoop
WINDOW_WIDTH = 700
WINDOW_HEIGHT = 700
NSAutoreleasePool.new
NSApp.activation_policy = LibAppKit::NSApplicationActivationPolicy::Regular
window = NSWindow.new(
http://binaries.openttd.org/bananas/newgrf/North_American_Renewal_Set-2.51.tar.gz
http://binaries.openttd.org/bananas/newgrf/eGRVTS2-188.tar.gz
http://binaries.openttd.org/bananas/newgrf/CHIPS_Station_Set-1.8.0.tar.gz
http://binaries.openttd.org/bananas/newgrf/FISH_ship_set-0.9.2.tar.gz
# Code
abstract class Interface
def initialize
end
property! application : Application
abstract def call
@RyanScottLewis
RyanScottLewis / application_interfaces.cr
Last active November 20, 2017 17:37
Error when trying to have a parent class initialize a child class using `self`
# Code
abstract class Interface
def initialize(@application : Application)
end
abstract def call
end