Skip to content

Instantly share code, notes, and snippets.

import os
import sys
import inspect
import timeflake
from peewee import *
from timeflake.extensions.peewee import TimeflakeBase62Field, TimeflakeUUIDField
# config
@bibby
bibby / factorio-thomas-notes.md
Last active October 28, 2022 18:54
Notes on making factorio-thomas

Really Useful Engines

Notes on making factorio-thomas, a mod for Factorio that adds several talking locomotives.

My son starting walking not long ago, and he can say a few words (mostly "this" and "that"), but he really likes Thomas & Friends, and will give an enthusiastic "toot, toot" whenever the little blue engine is seen.

Having just logged 200 hours in Factorio, I immediately got the itch to add these engines to the game, and get them huffing and puffing around my base. I set about reading the docs in the wiki, unpacking a few mods to inspect, and dusting cobwebs off the little bit of Lua that I knew.

Sprites

@bibby
bibby / cspan.sh
Created July 29, 2017 13:43
C-SPAN mp4 downloader
#!/bin/bash
# Download mp4s from C-SPAN
# Use: cspan CSPAN_URL [outfile]
# - script depends on jq and pup
# -- jq is a commandline json processor
# a precompiled binary can be obtained from https://github.com/stedolan/jq/releases
# -- pup is a commandline html processor (the jq of html/xml)
# a precompiled binary can be obtained from https://github.com/ericchiang/pup/releases
@bibby
bibby / renderer.js
Created March 20, 2017 17:51
skip expansion of numbers
var Marked = require('marked')
var cryptoz = require('crypto')
var Nsh = require('node-syntaxhighlighter')
var namer = require('./namer')
var Page = require('./models').Page
var directives = require('./directives')
var Configurable = require('./configurable')
var Configuration = function () {
Configurable.call(this)
@bibby
bibby / ass-to-txt.py
Created January 25, 2017 06:44
ass UTF-16 subfile to UTF-8 plain text
# rfw/python-ass does the heavy lifting,
# but I needed to hack around UTF-16 encoded files,
# saving them back as UTF-8
import ass
import re
import sys
in_file = sys.argv[1]
out_file = re.sub('[as]+$', 'txt', in_file)
#!/usr/bin/python
import os
from StringIO import StringIO
from ConfigParser import ConfigParser, NoOptionError
DOCUMENTATION = '''
---
module: directadmincfg
short_description: Sets options to a direct admin options conf
@bibby
bibby / panel.gd
Created March 12, 2014 14:59
gd sockets.. y u no write?
extends Panel
export(String) var host = "localhost"
export(int) var port = 7777
export(bool) var autoConnect = true
var Socket = preload("socket.gd")
var socket
func _init():
@bibby
bibby / rpc.gd
Created February 22, 2014 07:50
Godot HTTPClient usage
## rpc.gd
# An experiment in using HTTPClient
# for blocking RPCs
# @author bibby<bibby@bbby.org>
#
# get( url )
# post( url, body )
# put( url, body )
# delete( url )
@bibby
bibby / dropplets-oop.png
Last active December 25, 2015 08:29
dropplets oop plan
dropplets-oop.png
@bibby
bibby / dropplets-dip.png
Last active December 25, 2015 06:59
dropplets dependency inversion
dropplets-dip.png