Skip to content

Instantly share code, notes, and snippets.

aaronk6 / ddns_henet.rsc
Created April 26, 2023 20:55
RouterOS dynamic DNS update script for
View ddns_henet.rsc
# RouterOS dynamic DNS Update Script for
# =============================================
# Add your hostname and password below and adjust the waninterface
# if necessary. Then set up a scheduler to run this script periodically.
# CLI example:
# /system scheduler add interval=5m name=ddns_update on-event="/system script run ddns_henet" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-time=startup
aaronk6 / check-vault-encryption
Created October 19, 2018 14:39
Git pre-receive hook to ensure Ansible Vault encryption
View check-vault-encryption
#!/usr/bin/env bash
set -o errexit
set -o nounset
TEMPDIR=$(mktemp -d)
aaronk6 /
Last active April 2, 2023 21:33

Cross-browser implementation of navigator.msLaunchUri

Microsoft’s navigator.msLaunchUri method only works in Internet Explorer on Windows 8. Therefore I came up with a (nearly) cross-browser implementation that uses the native msLaunchUri when it’s available and falls back to adventurous hacks when running in other browsers.


launchUri (uri, successCallback, noHandlerCallback, unknownCallback)
aaronk6 /
Created September 25, 2014 15:20
ActionScript 3 source from (rev c9bf4139f7b29ff3394df0c6651c432cd9dfa235)
import flash.external.ExternalInterface;
var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
var scid= String(paramObj['scid']);
if(String(paramObj['src']).length>1) videoCanvas.source = String(paramObj['src']);
else videoCanvas.source = 'http://localhost:4020/static/video/en/current/video.m4v';
videoCanvas.addEventListener(VideoEvent.READY, ready);
aaronk6 / jquery-ajax-blob-arraybuffer.js
Last active June 1, 2020 19:10 — forked from SaneMethod/jquery-ajax-blob-arraybuffer.js
This fork supports request headers and returns text data if the request fails.
View jquery-ajax-blob-arraybuffer.js
* Register ajax transports for blob send/recieve and array buffer send/receive via XMLHttpRequest Level 2
* within the comfortable framework of the jquery ajax request, with full support for promises.
* Notice the +* in the dataType string? The + indicates we want this transport to be prepended to the list
* of potential transports (so it gets first dibs if the request passes the conditions within to provide the
* ajax transport, preventing the standard transport from hogging the request), and the * indicates that
* potentially any request with any dataType might want to use the transports provided herein.
* Remember to specify 'processData:false' in the ajax options when attempting to send a blob or arraybuffer -
View com.aaronk6.doorbell.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN >
<plist version="1.0">
aaronk6 /
Last active August 29, 2015 13:57
Send push notification when doorbell rings (using Tinkerforge Industrial Digital In 4 Bricklet)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Send push notification when doorbell rings
# using Tinkerforge Industrial Digital In 4 Bricklet
# License: CC BY-SA 3.0
# Based on
# The following changes were made:
aaronk6 /
Last active December 31, 2015 05:39
Converts all GIF files in the current folder and its subfolders to MP4 files so they can be used in applications that don't support animated GIFs. Tested on OS X 10.9, requires ffmpeg >= 1.2.
# Converts all GIF files in the current folder and its subfolders to MP4 files
# so they can be used in applications that don't support animated GIFs
# requires ffmpeg >= 1.2
# target format: H.264 baseline, level 3.0 @ 30 fps