Skip to content

Instantly share code, notes, and snippets.

View DanielOaks's full-sized avatar

Daniel Oaks DanielOaks

View GitHub Profile
@DanielOaks
DanielOaks / kiwibnc-config.ini
Last active February 18, 2023 17:44
kiwibnc configs
[log]
# level may be one of: trace, debug, info, notice, warn, error
level="info"
colour=true
[listeners]
bind = [
"0.0.0.0:3001",
]
@DanielOaks
DanielOaks / autoxm.py
Last active July 8, 2022 23:35
autotracker.py, for generating XM chiptunes!
#!/usr/bin/env python3
# AutoXM
# written by Daniel Oaks <daniel@danieloaks.net>
# released into the public domain
# inspired by the public domain autotracker by Ben "GreaseMonkey" Russell
import struct, random
# XM Module Handling
#
@DanielOaks
DanielOaks / irc.regex
Last active June 25, 2022 07:42
IRC Message Splitting Regex
Page explaining this regex: http://danieloaks.net/irc-regex/
Raw regex:
^(?:@([^\r\n ]*) +|())(?::([^\r\n ]+) +|())([^\r\n ]+)(?: +([^:\r\n ]+[^\r\n ]*(?: +[^:\r\n ]+[^\r\n ]*)*)|())?(?: +:([^\r\n]*)| +())?[\r\n]*$
Sample IRC messages:
foo bar baz asdf
@DanielOaks
DanielOaks / yt-playlist.py
Last active June 9, 2022 03:02
Creates an m3u playlist from files downloaded using youtube-dl
#!/usr/bin/env python3
# creates an m3u playlist sorted by upload date and then name for videos
# downloaded using youtube-dl (with the --write-info-json option)
# written in 2015 by Daniel Oaks <daniel@danieloaks.net>
# released under the CC0 Public Domain license
import os
import json
from natsort import natsorted

Taking photos of your art

If you're trying to take photos of your art, there are a few things to do:

  1. Try to get the light as consistent as possible.
  2. Use your photo editing app to crop the picture nicely.
  3. Use your photo editing app to make the picture 'pop'.

Doing these will help your art look a lot cleaner.

#! /bin/sh
# SMARTd discord notifier
export WEBHOOK_URL="https://discord.com/api/webhooks/YOUR_WEBHOOK_HERE"
export TMP_FILE=/tmp/smartd-discord
# assemble file
echo "**S.M.A.R.T. ERROR**" > $TMP_FILE
echo "> $SMARTD_MESSAGE" >> $TMP_FILE
<!--
this helps me work out which numbers I should put in the effects column of an
XM file to make the chords I've just played. I keep it open on a separate
screen while I'm editing the file with milkytracker. whoo~
-->
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/webmidi"></script>
<script>
@DanielOaks
DanielOaks / shift-jis.txt
Last active November 7, 2020 22:52
shift-jis sjis emoticons
̿̿ ̿̿ ̿’̿’̵͇̿̿з=༼ ▀̿̿Ĺ̯̿̿▀̿ ̿ ༽
͡ (ु ˲̥̥̥́ ˱̥̥̥̀) ु⁾⁾
͡ (ुŏ̥̥̥̥ ‸ ŏ̥̥̥̥) ु
̯ ̜ᵒ̴̶̷⁎).₊♪‧˚*
ੱ ಒౢੱ)₹Ⱡ੭
‾͟͟͞(((ꎤ >口<)̂ꎤ⁾⁾⁾⁾
‾͟͟͞(((ꎤ ✧曲✧)̂—̳͟͞͞o
‾͟͟͞(((ꎤˋ⁻̫ˊ)—̳͟͞͞o
‾͟͟͞(((ꎤ°᷄д°᷅)و ̑̑༉☆))Д´)
‾͟͟͞(((ꎤ๑‾᷅༬‾᷄๑)̂—̳͟͞͞

Parsing And Sending STATUSMSG Messages

STATUSMSG is a type of IRC private message / notice where the target of the private message is the members of a channel with at least a certain level of channel responsibility.

In other words, instead of the target of the message just being #ircv3, it may be @#ircv3 and only be send to the ops of the channel, rather than all members of the channel.

The STATUSMSG ISUPPORT Token

The STATUSMSG RPL_ISUPPORT token is used to note that the server supports sending private messages and notices with these special 'statusmsg targets' (the channel name prefixed by a given privilege level character such as +, %, @ or similar).

GLSL Shader Bits

Constants

#define pi acos(-1.)
#define tau (2.*pi)