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/bash | |
function scanpage { | |
echo -n insert $1 and press return | |
read | |
scanimage \ | |
-d 'brother5:bus2;dev2' \ | |
--AutoDocumentSize=yes \ | |
--format=pdf \ | |
--resolution 300 \ |
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 | |
require 'optimist' | |
opts = Optimist::options do | |
version "digits 0.2 (c) 2023 Nat Lasseter" | |
banner <<-EOS | |
Digits gives valid combinations of digits 1-9 that sum to the given total | |
Usage: |
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
% This is a cat. It behaves like a generic object. | |
-module(a_cat). | |
-behaviour(gen_object). | |
-export([initialise/1, handle_message/3]). | |
initialise([Name]) -> | |
{Name, "Meow"}. | |
handle_message(say, [Word], {Name, Word}) -> |
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 | |
n = ARGV.shift.to_i | |
m = n | |
m = ((m / 8) + 1) * 8 if m % 8 != 0 | |
p = (1..n).map(&:to_s) + ["{}"] * (m - n) | |
o = [] | |
until p.empty? do |
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 | |
#!DESCRIBE: Flash cards for table words | |
require "io/console" | |
data = DATA.each_line.map { |l| l.strip.split(?;) } | |
correct = 0 | |
total = 0 |
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
codewords = [] | |
class Integer | |
def rotate_left(bits, width = bit_width) | |
bits %= width | |
(self << bits | self >> (width - bits)) & ((1 << width) - 1) | |
end | |
end | |
(2**8).times do |candidate| |
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 normal mode, [ positions the cursor in the checkbox and waits for a character with which to replace the checkmark. | |
au FileType todo nnoremap [ 0t]r | |
"In insert mode, [ actually inserts a checkbox and a space. | |
au FileType todo inoremap [ [<Space>]<Space> | |
"Any file with a name ending in todo is a todo file. | |
au BufRead,BufNewFile *todo set ft=todo |
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 | |
#!DESCRIBE: Describe the purpose of an executable | |
require 'ptools' | |
def fatal(filename, msg) | |
$stderr.puts("[ERR] #{filename}: #{msg}") | |
exit 1 | |
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
#!/usr/bin/env ruby | |
Maths = Math | |
Radius = ARGV.shift&.to_f || 50.0 | |
Ring = ARGV.shift&.to_f || 15.0 | |
Decimals = 6 | |
Origin_x = Radius + Ring + 1 | |
Origin_y = Radius + Ring + 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
#!/usr/bin/env ruby | |
Maths = Math | |
Intervals = ARGV.shift&.to_i || 2 | |
Radius = ARGV.shift&.to_i || 25 | |
Decimals = ARGV.shift&.to_i || 3 | |
Scale = Maths::PI * 2 / Intervals | |
Width = 1 + Maths.log10(Radius).to_i + 1 + 1 + Decimals |
NewerOlder