Skip to content

Instantly share code, notes, and snippets.

View randyburden's full-sized avatar

Randy Burden randyburden

View GitHub Profile
@randyburden
randyburden / windows_to_iana_time_zone.sql
Created February 11, 2024 22:26
MySQL table for converting from a Windows TimeZone name to a IANA TimeZone name
/* MySQL table for converting from a Windows TimeZone name to a IANA TimeZone name */
CREATE TABLE IF NOT EXISTS `windows_to_iana_time_zone` (
`windows_time_zone` varchar(50) NOT NULL,
`iana_time_zone` varchar(50) NOT NULL,
PRIMARY KEY (`windows_time_zone`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO windows_to_iana_time_zone (windows_time_zone, iana_time_zone) VALUES
('Afghanistan Standard Time', 'Asia/Kabul'),
@randyburden
randyburden / time_zone.sql
Created February 11, 2024 21:33
MySQL TimeZone name table for converting between Windows TimeZone name and IANA TimeZone name
/* MySQL TimeZone name table for converting between Windows TimeZone name and IANA TimeZone name */
CREATE TABLE IF NOT EXISTS `time_zone` (
`id` bigint(20) NOT NULL,
`iana_time_zone` varchar(50) NOT NULL,
`windows_time_zone` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO time_zone (id, iana_time_zone, windows_time_zone) VALUES
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`iso2` char(2) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`countrycodenumeric` int(5) NOT NULL,
`countrycode` nvarchar(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@randyburden
randyburden / Updating Apple Pay Certificates.md
Created October 3, 2022 15:52
How to update Apple Pay certificates that are expiring

Updating Apple Pay Certificates

Overview

This document covers how to update the following Apple Pay certificates:

  • Apple Pay Payment Processing Certificate
    • Used to decrypt Apple Pay requests
  • Apple Pay Merchant Identity Certificate
    • Used to make requests to Apple Pay APIs
@randyburden
randyburden / blog.cwa.me.uk.user.css
Created September 26, 2022 22:01
Stylus - Dark mode theme for the The Morning Brew blog @ https://blog.cwa.me.uk
/* ==UserStyle==
@name The Morning Brew - Dark Mode
@version 1.0.0
@description Dark mode for the The Morning Brew blog @ https://blog.cwa.me.uk
@namespace github.com/RandyBurden
@author Randy Burden
@license MIT
==/UserStyle== */
@randyburden
randyburden / ProcDump - How to Capture a Memory Dump for a Specific Process.md
Created August 3, 2022 14:12
How to Capture a Memory Dump for a Specific Process using ProcDump and Debug with Visual Studio - Tested and works with .NET Core Apps

How to Capture a Memory Dump for a Specific Process using ProcDump and Debug with Visual Studio

  • Download ProcDump

  • Run this command file in an Administrator Console to capture a one-time memory dump for a specific processes:

    • procdump.exe YourProcessName -accepteula -ma C:\MemoryDumps\Dumps
      • Note, just use the name of the process that is displayed in the Task Manager
@randyburden
randyburden / Kill-Service-At-80-GB.ps1
Created August 3, 2022 13:54
PowerShell script to kill a process when it reaches a certain memory threshold. Writes output to console and a log file.
# Kills a specific Windows Service process if it uses over 80 GB of memory
# Note, be sure to set the Windows Service to restart instantly on failure
# To run this script manually, run the following 2 lines of PowerShell:
# powershell -command "C:\Temp\WindowsScheduledTaskScripts\Kill-Service-At-80-GB.ps1"
# $LASTEXITCODE
# To run as a Windows Scheduled Task:
# Set the program to run as "powershell"
# Set the command to: -Command ". C:\OneDine\WindowsScheduledTaskScripts\Kill-Service-At-80-GB.ps1; exit $LASTEXITCODE"
@randyburden
randyburden / Cloudflared Quick Tunnels.md
Created July 27, 2022 20:54
Cloudflare Quick Tunnels - ngrok alternative for exposing localhost ports to the internet

Cloudflare Quick Tunnels

Overview

  • Cloudflare Tunnels has a feature named "Quick Tunnels" that allows you to expose localhost ports to the internet via a dynamically generating unique URL.
  • Cloudflare Quick Tunnels is a free alternative to ngrok, which is a popular developer tool with more features, but does not allow you to have more than 1 instance running at a time without paying, whereas with Cloudflare Quick Tunnels there is no such limit.

Links

@randyburden
randyburden / SentimentPicker.html
Created May 24, 2022 22:46
Sentiment Picker (Negative, Neutral, Positive) written using Bootstrap, jQuery, and toastr. It allows the user to select a sentiment or ranking. Demo: https://codepen.io/randyburden/pen/Yzerbqv
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Sentiment Picker</title>
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css'>
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css'>
<style>
.sentiment-picker .btn {
color: #fff;
@randyburden
randyburden / Calendar_MSSQL.sql
Created March 17, 2022 22:04
SQL Calendar table script for MS SQL Server and MySQL databases. Populates in about 2 seconds.
/* Create Calendar table for MS SQL Server (Total runtime is less than 2 seconds to populate) */
-- DROP TABLE IF EXISTS Calendar
CREATE TABLE Calendar (
CalendarDate DATE NOT NULL PRIMARY KEY,
CalendarYear SMALLINT NULL,
CalendarMonth tinyint NULL,
CalendarDay tinyint NULL,
CalendarMonthName VARCHAR(9) NULL,
CalendarDayName VARCHAR(9) NULL,
CalendarDayofWeek tinyint NULL,