Skip to content

Instantly share code, notes, and snippets.

View colinlord's full-sized avatar

Colin Lord colinlord

View GitHub Profile
@colinlord
colinlord / sortMonarchs.js
Last active June 16, 2025 20:08
rendezvous with cassidoo 6/16
// Given an array of strings representing the names of monarchs
// and their ordinal numbers, write a function that returns the
// list of names sorted first by name and then by their ordinal
// value (in Roman numerals), in ascending order.
function sortMonarchs(names) {
const romanToInt = (roman) => {
const romanMap = {
I: 1,
@colinlord
colinlord / sandwich-menu-outline.svg
Created March 18, 2022 16:42
Sandwich Menu (Outline)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@colinlord
colinlord / sandwich-menu-fill.svg
Created March 18, 2022 16:40
Sandwich Menu (Fill)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@colinlord
colinlord / settings.json
Created October 8, 2020 17:17
My default vscode settings
// place in root of project as .vscode/settings.json
{
"workbench.colorCustomizations": {
"titleBar.activeForeground": "#fff",
"titleBar.inactiveForeground": "#000000CC",
"titleBar.activeBackground": "#F40009",
"titleBar.inactiveBackground": "#F40009CC"
},
@colinlord
colinlord / overlay.php
Created October 7, 2020 15:18
Nest + Weather Data Overlay
<?php
/* GET OUR WEATHER DATA */
// Get our JSON
$strJsonFileContents = file_get_contents("YOUR API LINK GOES HERE");
$weather = json_decode($strJsonFileContents, true);
// Convert temperature and dew point
$temp = round($weather[currently][temperature]) . '°';
@colinlord
colinlord / readystatechange.js
Created August 7, 2020 20:30
Fire JS after page is totally loaded
document.addEventListener("readystatechange", function () {
switch (document.readyState) {
case "complete":
{
// put your code here that will run after the page loads completely.
// if there is "flashing" and complaints are raised you can choose an earlier readyState
// always use "complete" if loading external resources
}
}
});