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 / 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 = @{
@aeveltstra
aeveltstra / powershell-measure-folder-traversal-methods.ps1
Last active March 17, 2023 21:34
Powershell: Measure folder traversal methods
param(
[Parameter(Mandatory=$true)][string]$Filter,
[Parameter(Mandatory=$true)][string]$Path
)
$current_year = (get-date).year;
$logging_time_format = "yyyyMMdd\tHHmmss";
$logging_time = Get-Date -Format $logging_time_format;
write-output "${logging_time}: Checking $Path for files that match filter ${Filter}.";
if (!(test-path $Path)) {
@aeveltstra
aeveltstra / qlikview-read-user-config-for-data-analysis-filters-on-the-fly.txt
Created January 23, 2023 15:53
QlikView read user config for data analysis filters on the fly
// Tell QlikView in what folder to look.
// The following assumes Windows-style directory separators,
// because QlikView runs on Windows, exclusively.
DIRECTORY \\server\Users\some_user\QlikView\settings;
// Load a spreadsheet named user_config.xls.
// It can be named anything, as long as you can recognize it.
// We gave the spreadsheet 3 columns: Setting, Value, and
// Explanation. Those live on a worksheet table named Settings.
user_config: