Skip to content

Instantly share code, notes, and snippets.

View dansloane's full-sized avatar

Dan Sloane dansloane

View GitHub Profile
Global Function SetAllShellys (state As Byte)
// dms/ssq/23.10.2022: Set all Shellys to a given state
// 0 = Off
// 1 = On
// 2 = Toggle current state
Var shellyDevice As Long := 0
Var shellyIP[16] As Text[15] :=
@dansloane
dansloane / square_vid_ffmpeg.txt
Last active June 13, 2016 14:50
Convert non-even sized PNG sequence to H264 using ffmpeg
# Sources
# http://hamelot.io/visualization/using-ffmpeg-to-convert-a-set-of-images-into-a-video/
# http://stackoverflow.com/a/20848224
# Tested on OS X with ffmpeg 3.0.2 via Brew
# PNG image sequence was 875x875
ffmpeg -r 25 -f image2 -s 874x874 -i paddedtofive_%05d.png
-vcodec libx264 -crf 25
-pix_fmt yuv420p
@dansloane
dansloane / caxton2xero.py
Last active August 29, 2015 14:07
Caxton Pre-paid card XLS (actually HTML) to Xero import
#!/usr/bin/python
# caxton2xero.py
# converts a Caxton Pre-paid card statement to CSV for Xero upload
# dms/ssq/29.09.2014
# Caxton pre-paid Visa card only have 'XLS' output, which is actually HTML
# Xero can import statements using QIF or CSV in a particular format
# http://help.xero.com/help/bankaccounts_details_importtranscsv.htm
#
@dansloane
dansloane / gist:857f3f0f5313a487c351
Created September 4, 2014 15:37
Wildcard copy from Android using ADB
adb shell ls /sdcard/gps*.trace | tr '\r' ' ' | xargs -n1 adb pull
Source: http://stackoverflow.com/a/11250068
@dansloane
dansloane / im_trim.txt
Created June 20, 2014 10:02
Trimming images with ImageMagick
When using IM trim to autocrop an image, the result includes a PNG offset. Use +repage to fix this.
convert inputimage.png -trim +repage outputimage.png
@dansloane
dansloane / gist:6f20a3bc8c647fea7cf0
Last active August 29, 2015 14:02
Install HMRC Basic PAYE Tools 2014 on Ubuntu 14.04LTS 64bit