This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/gnuplot -c | |
# Plot battery charge graph | |
logfile=ARG1 | |
tmp=system("mktemp") | |
logname=system("basename '" .logfile. "'") | |
set terminal qt persist noraise size 400,600 | |
set datafile separator ' ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:latest | |
ENV PATH=/drb:${PATH} | |
RUN apt update; apt -y install libcurl4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; WCAG contrast checker | |
; aquila12 (Lissa Moriarty) | |
; (c) 2022 | |
; Provided under the MIT license | |
; Select FG + BG colours to check | |
; Colours > Check WCAG Contrast Ratio | |
; Check status bar for report | |
; Based on the WCAG specifications |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def tick(args) | |
if args.tick_count.zero? | |
args.state.r10 ||= [100, 200] | |
args.state.r11 ||= [200, 100] | |
args.state.r20 ||= [100, 100] | |
args.state.r21 ||= [200, 200] | |
args.state.current_index = 0 | |
args.state.items = [args.state.r10, args.state.r11, args.state.r20, args.state.r21] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In-browser demo of static solids ("retained mode") | |
$points = 1000.times.map do |n| | |
[rand*1280, rand*720, 3, 3, rand*255, rand*255, rand*255, 255] | |
end | |
def move_points | |
50.times do |p| | |
p = $points[rand * $points.length] | |
p[0] += rand * 4 - 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In-browser test of tick rate when FPS is drooping | |
SOLIDS = 1000.times.map do |n| | |
[rand*1280, rand*720, 1, 1, rand*255, rand*255, rand*255, 255] | |
end | |
def tick args | |
@calls ||= 0 | |
@t0 ||= Time.now | |
@calls += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DragonRuby example showing save/load losing references | |
# Note how the ender-chests share an inventory, but on save/load they are separated | |
def empty_inventory | |
Hash.new { |h,k| h[k]=0 } | |
end | |
ITEMS = %i[books wood bricks leaves] | |
def defaults args |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Find the largest number below N which can be expressed as the sum of two cubes | |
TARGET = ARGV.shift&.to_i || 1_000_000_000 | |
class Numeric | |
def cubed | |
self ** 3 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Emote test page generator | |
; aquila12 (Lissa Moriarty) | |
; (c) 2022 | |
; Provided under the MIT license | |
; | |
; for Scheherazade | |
(define AUTHOR_MAIL "Lissa Moriarty <h9e72r38k@mozmail.com>") | |
(define AUTHOR_NAME "Lissa Moriarty") | |
(define AUTHOR_DATE "17 Mar 2019") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Aggressive update script for apt-based distributions | |
DPKG_OPTIONS=--force-confold | |
LOG=/var/log/aggressive-update | |
error() | |
{ | |
echo "$@" 1>&2 | |
exit |
NewerOlder