Skip to content

Instantly share code, notes, and snippets.

@gdyr
gdyr / GALReplay.ino
Created December 2, 2016 07:21
Replay of GAL hits
#define MX 2
#define A0 3
#define A1 4
#define RW 6
#define A2 7
#define A3 8
#define AL 9
#define DC 11
#define DS 12
var fs = require('fs');
var parse = require('csv-parse');
var transform = require('stream-transform');
var output = [];
var parser = parse({delimiter: ','})
var input = fs.createReadStream('lines.csv');
input.pipe(parser).pipe(transform(function(record, callback){
var pos = record[3];
@gdyr
gdyr / promise.lua
Created December 12, 2019 06:11
Quick Lua Promises (v0.1)
Promise = (function(asyncFunction)
local state = 'pending';
local result;
local rListen, eListen = {}, {};
asyncFunction(function(...)
for _,f in pairs(rListen) do
f(...);
end;

Locimation Stability & Support Tags

Locimation provides a range of open-source software, available at github.com/locimation.

Some projects may make use of undocumented features, or require further testing or development.

As such, we provide two types of graphical label to indicate the current status of the software.

Stability

@gdyr
gdyr / Mono Remote.PNG
Last active March 9, 2022 08:16
JetBrains Rider setup for S# Pro Debugging
Mono Remote.PNG
@gdyr
gdyr / cisco-igmp-monitor.ps1
Last active July 21, 2022 13:25
Monitor Cisco switch IGMP groups
function Get-CiscoIGMPGroups {
return plink -ssh cisco@10.10.10.17 -pw cisco -batch "sh ip igmp snooping groups | include 224.0.1.129" 2>$null | ? {$_.Length -gt 0};
}
Write-Output "Starting IGMP group monitoring."
Write-Output "Press any key to exit..."
Write-Output "";
$prevEntry = "";
do {
S = TcpSocket.New();
S.EventHandler = print;
S:Connect(<HOST>, 80);
S.ReconnectTimeout = 0;
function randomWebSocketKey()
return Crypto.Base64Encode(('x'):rep(16):gsub('.', function() return string.char(math.random(0,255)) end));
end;
S.Connected = function()
@gdyr
gdyr / redis.lua
Last active January 17, 2023 22:52
Q-Sys Redis Client
--[[
Q-Sys Redis Client
Author: Michael Goodyear
Email: michael@locimation.com
Version: 1.1
Copyright 2020 Locimation Pty Ltd
Permission is hereby granted, free of charge,
to any person obtaining a copy of this software
and associated documentation files (the "Software"),
@gdyr
gdyr / qsys-b64-img.lua
Created December 30, 2019 19:06
Q-Sys Dynamic button images
--[[
Notes:
- Remove any data:image/type; prefix
- Legend = '' prevents the Style JSON from appearing as the button label
- DrawChrome hides the button itself and just displays the image.
]]
Controls['Artwork'].Style = json.encode({
DrawChrome = false,
@gdyr
gdyr / list-playlists.lua
Last active January 17, 2023 22:53
List playlists on Q-Sys using Lua
-- First we find all the files in the "playlist" directory
PlaylistFiles = dir.get('media/Playlists/')
-- Next we make a table that's going to contain all our playlist names
PlaylistNames = {}
-- Next we go through the list of playlist files we've found
for _,f in ipairs(PlaylistFiles) do
-- Open the file