Skip to content

Instantly share code, notes, and snippets.

@HoraceBury
HoraceBury / ArchGen_ReadMe.md
Last active March 25, 2024 15:30
Generate Solution Architecture Diagram

Specify your architecture

  1. Specify as much detail as possible for your architecture, for example:
Design a simple solution architecture for a contact entry page which:
Requires no authentication to access
Collects and stores the name, phone number, address and email address of the contact
Uses ReactJS for the front end
API Gateway and Lambda in C# dotnet 6 for the backend
@HoraceBury
HoraceBury / tablelib.lua
Last active May 30, 2023 05:49
Lua table extensions used to improve and expand the table.* library in a simple manner.
-- table library extensions
if (dump == nil) then
dump = function(t)
print("=============")
for k,v in pairs(t) do
print("\t",k,v)
end
print("=============")
end
internal class Program
{
private static string[] urls = new string[] { "https://www.microsoft.com/", "https://www.youtube.com/", "https://www.airproducts.com/", "https://www.twitter.com/" };
private static void Main(string[] args)
{
PrepareTempFolders();
List<Runner> runners = new List<Runner>();
@HoraceBury
HoraceBury / ConsoleThreadBrowserTest.csproj
Last active May 8, 2023 08:18
Attempt to create multiple selenium edge browser instances in console app
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
@HoraceBury
HoraceBury / MultipleWindowTest.csproj
Last active May 3, 2023 15:29
Multiple Edge browser windows test in dotnet 6 C# with Selenium 4
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
@HoraceBury
HoraceBury / flood.lua
Last active May 2, 2022 04:13
Flood fill a display object with a Gfx2.0 gradient fill. Can be used to provide the Android Material Design button interaction animation, eg: http://www.google.com/design/spec/components/buttons.html#buttons-flat-raised-buttons
-- ref: http://docs.coronalabs.com/daily/guide/graphics/effects.html#generator.radialgradient
local back, outer, inner = {0,1,0,1}, {0,.9,0,.05}, {0,1,0,.05}
-- backing colour rect
display.newRect( display.actualCenterX*.5, display.actualContentHeight*.25, 220, 220 ).fill = back
-- radial fill rect
local r = display.newRect( display.actualCenterX*.5, display.actualContentHeight*.25, 200, 200 )
local function getRadius( r, xOffset, yOffset )
@HoraceBury
HoraceBury / utils.lua
Last active April 26, 2022 13:02
Miscellaneous utility functions which help get screen dimensions, extend display operations and some string functions.
-- utils
local composer = require("composer")
local utils = {}
function dump( ... )
if (#arg > 1) then
print("========================DUMP ("..#arg..")========================")
for i=1, #arg do
@HoraceBury
HoraceBury / _mathlib.lua
Last active February 27, 2022 12:17
Mathematics functions, including trigonometry. The main file demonstrates the use of the various maths extension functions available in the library. To use this remove the '_' from the filename.
-- mathlib.lua
local function dump(tbl)
print("====================")
for k,v in pairs(tbl) do
print(k,v)
end
print("====================")
end
@HoraceBury
HoraceBury / shadow.lua
Created April 27, 2015 05:30
Create a drop shadow
local function shadow( width, height, size )
local g = display.newGroup()
g.x, g.y = display.contentCenterX, display.contentCenterY
display.newRect( g, 0, 0, width+size, height+size ).fill = {1,1,1,0}
display.newRect( g, 0, 0, width, height ).fill = {0,0,0}
local c = display.capture( g )
g = display.remove( g )
@HoraceBury
HoraceBury / dragitemscrollview.lua
Created December 30, 2016 14:48
Provides a scrollview widget which can have items dragged off it.
local widget = require("widget")
local function angleOf( ax, ay, bx, by, adjust, positive )
local angle = math.atan2( by-ay, bx-ax ) * 180/math.pi
if (adjust) then
if (type(adjust) ~= "number") then adjust = -90 end
angle = angle - adjust
if (angle < -180) then angle=angle+360 end
if (angle > 180) then angle=angle-360 end