Skip to content

Instantly share code, notes, and snippets.

View randyburden's full-sized avatar

Randy Burden randyburden

View GitHub Profile
@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 / 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
@randyburden
randyburden / CodeMirror_CurlyBraceWrappedText_Demo
Created October 21, 2014 23:21
CodeMirror Custom Syntax Highlighter for highlighting double curly brace wrapped text aka Mustache / Handlebars
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CurlyBraceWrappedText Demo</title>
<style type="text/css">
.CodeMirror {border: 1px solid black;}
.cm-CurlyBraceWrappedText {color: #CC0000; font-weight: bold;}
</style>
<link rel="stylesheet" href="css/codemirror.css">
@randyburden
randyburden / RoundRobinList.cs
Created November 12, 2021 03:43
C# Round Robin List that uses a simple, thread-safe, round-robin load balancing algorithm where it provides the next item in the list each time the Next method is called and starts back at the top of the list when it reaches the end of the list.
using System;
using System.Collections.Generic;
using System.Linq;
namespace Helpers
{
/// <summary>
/// Creates a round robin list that uses a simple, thread-safe, round-robin
/// load balancing algorithm where it provides the next item in the list each
/// time <see cref="Next"/> is called and starts back at the top of the list
@randyburden
randyburden / HttpClient.js
Created May 11, 2015 03:52
Simple JavaScript HTTP Client. Supports GET and POST.
httpClient = {
get: function( url, data, callback ) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
var readyState = xhr.readyState;
if (readyState == 4) {
callback(xhr);
}
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 / ConsoleColorExtensions.cs
Created September 20, 2017 14:08
C# extension/helper class for writing colored output to the console. This is sort-of a workaround of not being able to extend the static Console class.
using System;
namespace Utilities.Extensions
{
public static class ConsoleColorExtensions
{
/// <summary>
/// Writes the specified string value, followed by the current line terminator, to the standard output stream.
/// </summary>
/// <example>
@randyburden
randyburden / Add_Yourself_As_A_Sql_Server_Express_SysAdmin.txt
Created November 28, 2012 21:45
Add Yourself as a SQL Server Express SysAdmin
Adding Yourself as SQL Server Express SysAdmin
----------------------------------------------
Problem:
The help desk installs SQL Server on our developer machines under their own user accounts meaning you aren't a
sysadmin on your own SQL Server Express instance which in turn means you can't create a new database.
Solution:
@randyburden
randyburden / BooleanJsonConverter.cs
Created July 4, 2013 04:42
A Json.NET JsonConverter that can handle converting the following values into boolean values: true, false, yes, no, y, n, 1, 0.
using System;
using Newtonsoft.Json;
namespace JsonConverters
{
/// <summary>
/// Handles converting JSON string values into a C# boolean data type.
/// </summary>
public class BooleanJsonConverter : JsonConverter
{