Skip to content

Instantly share code, notes, and snippets.

View BenLubar's full-sized avatar

Ben Lubar BenLubar

View GitHub Profile
@BenLubar
BenLubar / Q.tsv
Last active August 29, 2015 13:55
the vaules for entity[Q*] in tab separated values format
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 126 columns, instead of 23. in line 3.
256 1 0 260 0 256 1 0 78 1 0 86 0 0 0 0 -1 -1 -1 1000 0 -1 -1 -1 -1 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3328 256 256 256 256 3840 0 256 3840 3840 0 0 0 0 0 512 3840 3840 3840 3840 3840 3840 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -256 -1 255 0 -256 -1 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 262 0 256 1 0 98 1 0 50 0 0 0 0 -1 -1 -1 0 0 -1 -1 -1 -1 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3328 256 256 256 256 3840 0 256 3840 3840 0 0 0 0 0 512 3840 3840 3840 3840 3840 3840 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -256 -1 255 0 -256 -1 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
256 1 0 257 0 256 1 0 78 1 0 29 0 0 0 0 -1 -1 -1 20 0 -1 -1 -1 -1 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3328 256 256 256 256 3840 0 256 3840 3840 0 0 0 0 0 512 3840 3840 3840 3840 3840 3840 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -256 -1 255 0 -256 -1 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1280 1 0 260 0 256 1 0 75 1 0 31 0 0 0 0 -1 -1 -1 -1 0 -1 -
require 'json'
stats = {}
map = ""
Dir['logs/*.log'].sort.each do |fn|
open fn do |f|
cvars = false
bomb_planted = false
@BenLubar
BenLubar / gist:9158673
Created February 22, 2014 17:36
species generator output
Body:
Upper:
Head:
Eye:
Eye:
Head:
Eye:
@BenLubar
BenLubar / species.txt
Last active August 29, 2015 13:56
species generator output
It is huge with beige rough leathery skin. Its upper body is quite short and
very narrow. Its head is long and very wide. It has a extremely short, quite
wide mouth containing two gigantic tusks, three miniscule molars, five large
tusks, three small tusks, two tiny tusks, six large fangs, three tiny tusks,
and seven huge fangs. It has five quite short, quite wide wing-limbs, each with
no joints. Its lower body is long and narrow. It has four long, wide tails.
--------------------------------------------------------------------------------
It is small with maroon vapor-like skin. Its upper body is long and narrow. Its
@BenLubar
BenLubar / .gitignore
Last active August 29, 2015 13:57
lojban irc log parser/glosser
irclogs.zip
all_logs.txt
logs_translated.txt
logs_untranslated.txt
@BenLubar
BenLubar / credit_card.rb
Created April 11, 2014 05:07
This program prints your credit card number, followed by a newline. There may be some other output as well.
def credit_card k, n
a = [0] * k * n
d = lambda do |t, p|
if t > n
if n % p == 0
for j in 1..(p + 1)
yield a[j]
end
end
else
ackermann :: Integer -> Integer -> Integer
ackermann 0 n = n+1
ackermann m 0 = ackermann (m-1) 1
ackermann m n = ackermann (m-1) (ackermann m (n-1))
up :: Integer -> Integer -> Integer -> Integer
up a b 0 = a*b
up a b 1 = a^b
up _ 0 _ = 1
up a b n = up a (up a (b-1) n) (n-1)
@BenLubar
BenLubar / gen.bash
Last active August 29, 2015 14:01
Generates world maps for 2499 years of Dwarf Fortress world gen.
#!/bin/bash
sed -i data/init/world_gen.txt -e 's/\[BEAST_END_YEAR:.\+:.\+\]/[BEAST_END_YEAR:10000:-1]/'
for year in {2..2500}
do
sed -i data/init/world_gen.txt -e 's/\[END_YEAR:[0-9]\+\]/[END_YEAR:'$year']/'
./libs/Dwarf_Fortress -gen '1' 'Dorf' 'LARGE REGION'
convert "world_map-region1-$year--10081.bmp" "world_map-region1-$year.png"
convert "world_graphic-region1-$year--10081.bmp" "world_graphic-region1-$year.png"
rm "world_map-region1-$year--10081.bmp"
@BenLubar
BenLubar / a4.md
Created August 7, 2014 08:13
a list of all utf-8 characters containing the byte 0xA4
  • U+00A4 ¤ (c2 a4)
  • U+00E4 ä (c3 a4)
  • U+0124 Ĥ (c4 a4)
  • U+0164 Ť (c5 a4)
  • U+01A4 Ƥ (c6 a4)
  • U+01E4 Ǥ (c7 a4)
  • U+0224 Ȥ (c8 a4)
  • U+0264 ɤ (c9 a4)
  • U+02A4 ʤ (ca a4)
  • U+02E4 ˤ (cb a4)