Skip to content

Instantly share code, notes, and snippets.

@keisisqrl
keisisqrl / gist:dcc9ce46bb64b0a65bdb
Last active December 8, 2017 21:58
Budgeting gas (as dollars) breaks ledger
; run 'ledger budget' or 'ledger budget -B' or 'ledger budget -X $' using this file
; 'ledger budget' or -B: Error: Cannot convert a balance with multiple commodities to an amount
; 'ledger budget -X $': Error: Cannot add an uninitialized value to an amount
~ Monthly
Expenses:Auto:Fuel $200.00
Expenses:Test $60
Assets:Budget
@keisisqrl
keisisqrl / hook.js
Last active January 9, 2016 17:33
yoprs
// compiled from Hot Cocoa Lisp
// (set module.exports
// ;begin code
// (# (hook)
// (def login-line (get hook.env (+ 'APRS_' hook.params.username)))
// (def callsign (cadr (login-line.split ' ')))
// (def ax25 (+ callsign '>APRS,TCPIP*:>This is a test'))
// (hook.res.end (+ login-line '\r\n' ax25))
// )
@keisisqrl
keisisqrl / aprs_hook.js
Last active February 2, 2016 01:22
Aprs checkin via Yo and hook.io
// This is designed to run on hook.io but you could probably customize it
module['exports'] = function yo_aprs (hook) {
var request = require('request');
//var numeral = require('numeral');
// IF you want to use this, change this
if ( hook.params["username"] != "KEISISQRL" ) {
console.log("bad user");
@keisisqrl
keisisqrl / vc-fossil.el.patch
Created September 6, 2017 19:02
vc-fossil patch for emacs 25
150c150
< (vc-fossil-dir-status-files dir nil nil update-function))
---
> (vc-fossil-dir-status-files dir nil update-function))
152c152
< (defun vc-fossil-dir-status-files (dir files default-state update-function)
---
> (defun vc-fossil-dir-status-files (dir files update-function)
207c207
< (defun vc-fossil-register (files &optional rev comment)
@keisisqrl
keisisqrl / uuidgen.sql
Last active June 17, 2024 20:18
uuidgen for sqlite
/* uuidgen.sql
*
* creates a view uuidgen(uuid TEXT) which generates v4 UUIDs on demand
* generated per RFC 4122
*
* it's not a stored procedure exactly but subqueries are allowed in
* any expression
**/
CREATE VIEW uuidgen AS
SELECT printf('%x-%x-%x-%x-%x',
@keisisqrl
keisisqrl / load_tweets.tcl
Last active December 12, 2018 01:37
load tweets from json in backup into sqlite3
package require sqlite3
sqlite3 db tweets.sqlite3
db eval {DROP TABLE IF EXISTS tweetjson}
db eval {create table tweetjson (id INTEGER PRIMARY KEY, tweet TEXT)}
foreach srcjs [glob {*.js}] {
set inchan [open $srcjs]
gets $inchan
@keisisqrl
keisisqrl / expenses.tcl
Created December 14, 2018 05:46
tk app to track expenses with receipts
package require Tk 8.6
package require sqlite3
sqlite3 db expenses.db
db eval {
PRAGMA auto_vacuum='incremental';
}
db eval {
@keisisqrl
keisisqrl / decodeResponse.elm
Created September 27, 2019 20:35
Utility functions to decode Http binary file response to data URI in elm
import Base64 exposing (fromBytes)
import Bytes exposing (Bytes)
import Dict
import Http exposing (Response(..))
import Result exposing (fromMaybe)
dataReadyResponse : Bytes -> Result Http.Error String
dataReadyResponse =
fromBytes
@keisisqrl
keisisqrl / dl44.scad
Created March 21, 2020 00:25
basic dl44 muzzle attachment (under development)
use <threads.scad>
test = true;
$fn = 32;
bottom_height=25;
add_to_muz=50;
thread_len = 10.16;
@keisisqrl
keisisqrl / README.md
Last active November 6, 2020 19:23
cloud-init for neko

cloud-init config for nurdism/neko

Tested on DigitalOcean with Ubuntu 20.10 LTS

Put in a valid email and hostname where shown. Update DNS when you get an IP. Short TTL recommended.

The TLS provider for the neko service can be changed from stage to prod when ready.