Skip to content

Instantly share code, notes, and snippets.

View aeveltstra's full-sized avatar

Ænðr E. Feldstraw aeveltstra

View GitHub Profile
@aeveltstra
aeveltstra / powershell-gui-aws-lambda-start-functions.ps1
Last active June 14, 2024 23:47
A Powershell GUI using DotNet Windows.Forms to start AWS Lambda Functions and display their output
<#
# To start known AWS Lambda Functions.
#
# You MUST have the AWS CLI installed. Run this command to install:
# PS$> Install-Module -Name AWS.Tools.Lambda
#
# You MUST have it configured with an account that has access
# to AWS Lambda Functions.
#
# @author A.E.Veltstra
@aeveltstra
aeveltstra / example-powershell-windows-forms-creation.ps1
Last active May 31, 2024 17:21
Example Powershell Windows Forms GUI Creation
<#
# This is a trial for how to make windows and menus using Powershell,
# that can invoke other programs and scripts.
#
# @author A.E.Veltstra
# @since 2.24.517.1520
# @version 2.24.531.1201
#>
# Add-Type works like an import or require command.
@aeveltstra
aeveltstra / qlikview-custom-colors.vbs
Created February 19, 2024 18:46
QlikView custom colors
/* Color variables for presentation */
LET colorLighterBlue=RGB(231,244,255);
LET colorDarkerBlue=RGB(214,236,255);
LET colorLighterGreen=RGB(242,250,234);
LET colorDarkerGreen=RGB(208,236,182);
LET colorLighterRed=RGB(252,224,237);
LET colorDarkerRed=RGB(243,219,219);
LET colorRowBackgroundBuyPrimary=White();
LET colorRowBackgroundBuyAlt=RGB(226,231,243);
LET colorHeaderLighterBlue=RGB(115,138,200);
@aeveltstra
aeveltstra / eclipse-ide-high-contrast-black-java-syntax-color-settings.epf
Last active January 22, 2024 20:36
Eclipse IDE high-contrast black java syntax color settings
#Mon Jan 22 13:52:37 EST 2024
\!/=
/instance/\!/=
/instance/org.eclipse.jdt.ui/enclosingBrackets=true
/instance/org.eclipse.jdt.ui/escapeStringsNonAscii=true
/instance/org.eclipse.jdt.ui/highlightBracketAtCaretLocation=true
/instance/org.eclipse.jdt.ui/java_bracket=255,255,0
/instance/org.eclipse.jdt.ui/java_default=192,192,192
/instance/org.eclipse.jdt.ui/java_doc_default=127,159,191
/instance/org.eclipse.jdt.ui/java_doc_link=128,128,255
@aeveltstra
aeveltstra / date-and-hour-ranges-for-iterating.py
Created November 16, 2023 20:37
Python date and hour ranges for iterating
# These tests help understand how python generates ranges of dates
# and hours that can be iterated over.
import datetime
def make_date_by_day(days_back):
now = datetime.datetime.utcnow()
at_9am = datetime.datetime(now.year, now.month, now.day, 9, 0,0,0)
back_then = at_9am - datetime.timedelta(days=abs(days_back))
return back_then
@aeveltstra
aeveltstra / haskell-webserver.cabal
Created November 3, 2023 15:23
Cabal build file for the haskell webserver
cabal-version: >=1.10
-- Package description generated by 'cabal init'. For further documentation,
-- see http://haskell.org/cabal/users-guide/
name: webserver
version: 0.1.0.1
-- synopsis:
-- description:
-- bug-reports:
-- license:
@aeveltstra
aeveltstra / haskell-webserver.hs
Created November 3, 2023 14:50
Haskell Webserver
{-# LANGUAGE OverloadedStrings #-}
{- | Sample Haskell Web Application
- Based on WAI, implemented with the WARP web server.
- See https://www.yesodweb.com/book/web-application-interface
- See https://www.stackage.org/package/wai
-}
import Network.Wai
import Network.Wai.Handler.Warp (run)
import Network.Wai.Middleware.RequestLogger
import Network.Wai.Application.Static
@aeveltstra
aeveltstra / php-unit-testing-without-a-framework.php
Created October 15, 2023 13:48
php-unit-testing-without-a-framework
<?php
/**
* We don't always have the ability to use Composer on every PHP server we use.
* We also don't always have the spoons to vet every library or module. And yet,
* we still need to perform unit tests.
*
* Here's one way to perform unit tests in PHP 7.4 and newer. Everything is
* contained in this one page. Import the scripts that have functions to test,
* add them to a test batch, and load this page to run the tests and see the
* results printed to screen.
@aeveltstra
aeveltstra / tsql-select-values-except-exists-in-table
Created October 4, 2023 16:35
TSQL select values from list which do not exist in table
/**
* Introducing the EXCEPT operator.
* To select values from a list, use the VALUES operator, and assign that to a table keyword, like so:
*/
SELECT dagnaam FROM (VALUES
('maandag'),
('dinsdag'),
('woensdag')
) E(dagnaam);
@aeveltstra
aeveltstra / update-remote-scheduled-task-action.ps1
Created June 15, 2023 16:54
Powershell: updating actions of MS Windows scheduled tasks that run on remote servers
<#
# Updating actions of existing, known scheduled tasks to the newest known application version.
# The script assumes that each task has exactly 1 action. Other actions will get deleted.
#
# Author: A.E.Veltstra
# Version: 2.23.607.1200
#>
# List all remote servers to be processed.
$hosts = @{