Skip to content

Instantly share code, notes, and snippets.

@prehensile
prehensile / timezone.py
Last active March 22, 2018 23:10
Parses timezone strings in ISO 8601 format to datetime.tzinfo objects
import datetime
import re
import logging
class TimeZone( datetime.tzinfo ):
def __init__( self, offset ):
# expects offset in ISO 8601 format e.g '+00:00', '+0000', 'Z'
# see https://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators
@prehensile
prehensile / dj-rnn.txt
Last active September 4, 2018 23:44
9012 DJ names generated by torch-rnn, trained on listings at residentadvisor.net
Aromino Lu
Farlos Gabate
Kukog Gracux
Cassunex De 90C
Alex Nede
Jeerra Bylentron
Eddeysive
Fair Figo
Andries Gamper
Ladewenteah
@prehensile
prehensile / gnm-server.js
Created May 8, 2018 09:09
Bits and pieces of gig'n'mix
// http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
"use strict";
// Optional. You will see this name in eg. 'ps' or 'top' command
process.title = 'node-chat';
// Port where we'll run the websocket server
var webSocketsServerPort = 1337;
// websocket and http servers
@prehensile
prehensile / features.md
Last active December 29, 2018 18:38
Specs for SIM800 board GSM-GPRS-V4.72, designed by UNV. Copypasted from ebay for reference.

Features

NOTE: Not my specs, copypasted from ebay for reference.

  • Serial interface: TTL/USART serial support.
  • Antenna circuit: Three common antenna interfaces (SMA interface only soldered)
  • Two way power interface: DC IN 5 v DC power supply OR 3.5-4.2 V power supply, suitable for lithium battery power supply applications.
  • Audio interface: increased by 3.5 MM audio interface, easily implement voice calls, voice broadcast, etc.
  • SIM booth: new mainstream type metal MICRO thrust booth, strong and durable.
  • LED indicator light: onboard two LED indicators. Allows you to monitor module working condition.
@prehensile
prehensile / raspi-streamer.md
Last active March 8, 2020 20:55
setting up a raspberry pi for streaming

Setting up a Raspberry Pi for use as an audio streamer

TODO

  • Automate setup of spotify in the browser (autofill login etc), probbaly using selenium -- This is probably needed in a caretaker process too, keep an eye on Spotify and reload if "something went wrong" message comes up
  • Implement exclusive playback between spotify / shairport: if one starts playing, the other stops
@prehensile
prehensile / GenerateParentzoneGalleryImageLinks.user.js
Last active December 23, 2024 14:07
Userscript and instructions for downloading images from a ParentZone gallery
@prehensile
prehensile / asterisk.log
Created September 28, 2020 22:26
asterisk log 202009282326
[2020-09-28 23:24:30] VERBOSE[29964][C-0000000e] pbx.c: Executing [9001@from-internal:1] Set("PJSIP/2001-0000000d", "__RINGTIMER=15") in new stack
[2020-09-28 23:24:30] VERBOSE[29964][C-0000000e] pbx.c: Executing [9001@from-internal:2] ExecIf("PJSIP/2001-0000000d", "0?Set(__CWIGNORE=)") in new stack
[2020-09-28 23:24:30] VERBOSE[29964][C-0000000e] pbx.c: Executing [9001@from-internal:3] Macro("PJSIP/2001-0000000d", "exten-vm,novm,9001,0,0,1") in new stack
[2020-09-28 23:24:30] VERBOSE[29964][C-0000000e] pbx.c: Executing [s@macro-exten-vm:1] Macro("PJSIP/2001-0000000d", "user-callerid,") in new stack
[2020-09-28 23:24:30] VERBOSE[29964][C-0000000e] pbx.c: Executing [s@macro-user-callerid:1] Set("PJSIP/2001-0000000d", "TOUCH_MONITOR=1601331870.13") in new stack
[2020-09-28 23:24:30] VERBOSE[29964][C-0000000e] pbx.c: Executing [s@macro-user-callerid:2] Set("PJSIP/2001-0000000d", "AMPUSER=2001") in new stack
[2020-09-28 23:24:30] VERBOSE[29964][C-0000000e] pbx.c: Executing [s@macro-user-callerid:3] Set("PJSIP/200
@prehensile
prehensile / SB2 Speaker EQ.json
Created November 15, 2020 17:10
PulseEffects presets for Microsoft Surface Book 2 speakers
{
"spectrum": {
"show": "true",
"n-points": "100",
"height": "120",
"use-custom-color": "false",
"fill": "true",
"show-bar-border": "true",
"sampling-freq": "10",
"line-width": "2",
// ==UserScript==
// @name FOOM! Ticker
// @namespace http://tampermonkey.net/
// @version 2024-09-17
// @description Insert a news ticker over a Google Slides presentation
// @author [email protected]
// @match https://docs.google.com/presentation/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=google.com
// @run-at document-start
// @resource IMPORTED_CSS https://fresh-half-ogre.glitch.me/ticker.css