Skip to content

Instantly share code, notes, and snippets.

View kindfulkirby's full-sized avatar

Kirby kindfulkirby

View GitHub Profile
@kindfulkirby
kindfulkirby / gist:ba5ee1752044ebf372fc6e5bbaf8b29f
Last active October 19, 2017 04:23
Weechat low priority notifications
/trigger add add_unread_marker print "" "${buffer.full_name} != ${env:urm_buffer} && ${buffer.short_name} =~ ^# && ${tg_displayed}" "" "/command -buffer ${buffer[${tg_signal_data}].full_name} * buffer set short_name 💬${channel}"
/trigger add del_unread_marker signal "buffer_switch" "${buffer.short_name} =~ ^💬" "" "/command -buffer ${buffer[${tg_signal_data}].full_name} * buffer set short_name ${channel}"
/trigger add set_unread_marker_env signal "buffer_switch" "" "" "/mute /set env urm_buffer ${buffer[${tg_signal_data}].full_name}"
/set weechat.look.buffer_notify_default highlight
@kindfulkirby
kindfulkirby / snes.ino
Last active October 5, 2017 14:02 — forked from netalkGB/snes.ino
Digispark SNES controller
#include "DigiJoystick.h"
#define DAT 0
#define PS 1
#define CLK 2
#define PULSE_TIME 3
char buf[8] = {
0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
@kindfulkirby
kindfulkirby / showmac.py
Last active March 24, 2016 14:42
Raspberry PI: If pin 21 is pulled to ground (just connect the two pins at the USB end of the GPIO header, preferrably put a jumper over them) write MAC addresses to file
import fcntl, socket, struct
import RPi.GPIO as GPIO
def get_mac(interface):
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
info = fcntl.ioctl(s.fileno(), 0x8927, struct.pack('256s', interface[:15]))
return ':'.join(['%02x' % ord(char) for char in info[18:24]])
except(IOError):
@kindfulkirby
kindfulkirby / post-commit
Last active August 29, 2015 14:15
Git hook to publish things
#!/usr/bin/env python3.2
import subprocess, re
matchers = {
'../scripts/public-add': re.compile('[AM]\tpublic/[\w.]'),
'../scripts/public-del': re.compile('D\tpublic/[\w.]'),
}
for line in subprocess.check_output(["git", "show", "--name-status"]).decode().split('\n')[4:-1]:
@kindfulkirby
kindfulkirby / content.st
Last active August 29, 2015 14:14
gitit: content.st template that automatically adds metadata
<div id="content">
$if(revision)$
<h2 class="revision">Revision $revision$</h2>
$endif$
<h1 class="pageTitle"><a href="$base$$pageUrl$">$pagetitle$</a></h1>
$if(messages)$
$messages()$
$endif$
$content$
<script type="text/javascript">