Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View sivers's full-sized avatar

Derek Sivers sivers

View GitHub Profile
@sivers
sivers / OpenBSD-buildError.txt
Created April 8, 2020 12:53
Nim OpenBSD build error
# OS: openbsd
# CPU: amd64
gcc -w -O3 -fno-strict-aliasing -fno-ident -Ic_code -c c_code/1_2/stdlib_assertions.nim.c -o c_code/1_2/stdlib_assertions.nim.o
gcc -w -O3 -fno-strict-aliasing -fno-ident -Ic_code -c c_code/2_2/stdlib_dollars.nim.c -o c_code/2_2/stdlib_dollars.nim.o
gcc -w -O3 -fno-strict-aliasing -fno-ident -Ic_code -c c_code/1_2/stdlib_formatfloat.nim.c -o c_code/1_2/stdlib_formatfloat.nim.o
gcc -w -O3 -fno-strict-aliasing -fno-ident -Ic_code -c c_code/4_2/stdlib_io.nim.c -o c_code/4_2/stdlib_io.nim.o
gcc -w -O3 -fno-strict-aliasing -fno-ident -Ic_code -c c_code/7_2/stdlib_system.nim.c -o c_code/7_2/stdlib_system.nim.o
gcc -w -O3 -fno-strict-aliasing -fno-ident -Ic_code -c c_code/2_2/stdlib_parseutils.nim.c -o c_code/2_2/stdlib_parseutils.nim.o
gcc -w -O3 -fno-strict-aliasing -fno-ident -Ic_code -c c_code/2_2/stdlib_math.nim.c -o c_code/2_2/stdlib_math.nim.o
gcc -w -O3 -fno-strict-aliasing -fno-ident -Ic_code -c c_code/1_2/stdlib_algorithm.nim.c -o c_code/1_2/stdlib_algorithm.nim.o
@sivers
sivers / audiobook.rb
Created June 25, 2019 20:32
Create my audiobook, 88 chapters with 9 ingredients to each chapter, using Ruby + sox
#!/usr/bin/env ruby
# if limiting to one chapter, ./audiobook.rb 05
LIMIT = (ARGV[0] =~ /\A[0-9][0-9]\Z/) ? ARGV[0] : false
BASE = Dir.pwd + '/'
NUMS = BASE + 'ChapterNums/'
DRUM = BASE + 'DrumFills/'
GUIT = BASE + 'GuitarChords/'
URLS = BASE + 'URLs/'
@sivers
sivers / podcast.rb
Created October 29, 2019 21:30
Podcast RSS generator in Ruby
#!/usr/bin/env ruby
require 'date'
require 'xml'
def htmlit(infile)
lines = File.readlines(infile)
/<!--\s+(.+)\s+-->/.match lines.shift
lines.unshift('<h2>%s</h2>' % $1)
html = ''
lines.each do |line|