Skip to content

Instantly share code, notes, and snippets.

View Daniel-Walsh's full-sized avatar
So much to code, so little sleep...

Dan Walsh Daniel-Walsh

So much to code, so little sleep...
View GitHub Profile
@Daniel-Walsh
Daniel-Walsh / color.ts
Created April 24, 2023 05:49 — forked from mnpenner/color.ts
RGB color hex to lightness
// based on https://stackoverflow.com/a/56678483/65387
type RGB = [r: number, g: number, b: number]
const UNK = 255 / 2
/**
* @param hex RGB hex string like "#CCCFDB"
* @returns RGB tuple in [0-255]
*/
@Daniel-Walsh
Daniel-Walsh / lorem-ipsum-words.txt
Created April 11, 2023 05:42
List of words used in the generation of lorem ipsum text
lorem
ipsum
dolor
sit
amet
consectetur
adipiscing
elit
sed
do
@Daniel-Walsh
Daniel-Walsh / servicenow-identicons.userscript.js
Created March 27, 2023 06:08
Replaces the stock avatars (initials) with hash-generated Identicons. It also decorates each activity with an Identicon embellishment.
// ==UserScript==
// @name Indenticons for ServiceNow
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Generates an Identicon for each item in the Activities list in a ServiceNow ticket.
// @author Dan Walsh
// @match https://*.service-now.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=service-now.com
// @grant none
// ==/UserScript==
@Daniel-Walsh
Daniel-Walsh / tailwind.config.js
Last active November 17, 2021 22:40
Add em spacing to TailwindCSS #tailwindcss
// Adds new spacing classes using `em` instead of `rem`. For example:
// .w-4~
// .h-8~
// .mx-12~
// .pl-6~
const defaultTheme = require("tailwindcss/defaultTheme");
module.exports = {
//... general configuration
@Daniel-Walsh
Daniel-Walsh / README.md
Last active October 5, 2021 01:11
Serving JSON content from Squiz Matrix #matrix #json

Serving JSON content from Squiz Matrix

In order for Squiz Matrix to properly set the content type of the server response, you must apply a specific design to the page outputting your JSON data.

Your design should contain only the following code:

<MySource_PRINT
  id_name="__global__"
 var="content_type"
@Daniel-Walsh
Daniel-Walsh / README.md
Last active October 6, 2021 05:05
Git command cheat sheet

Git command cheat sheet

fred

🗑 Remove untracked files and directories

$ git clean -d -f

Parameters

  • -d — Includes directories
@Daniel-Walsh
Daniel-Walsh / render-object-props-in-jsx.js
Last active October 1, 2021 02:28
Loop through and render Object key/values with React JSX #react #jsx #objects
// Create an Array from the object's keys, then use .map() to loop through each
// key and return your new Array of JSX elements for rendering. Object values
// can be accessed using bracket notation.
const RenderObjectKeyValues = () => {
const recipeTags = {
asian: 1,
beef: 2,
breakfast: 2,
cakes: 2,
@Daniel-Walsh
Daniel-Walsh / the-problem.txt
Created November 5, 2020 09:44
Use box-shadow to extend your footer when your content doesn't reach the window max-height #css #webdev
-------------------
| | 100px height
| HEADER |
|-----------------|
| |
| MAIN | 500px height
| |
|-----------------|
| |
| FOOTER |
@Daniel-Walsh
Daniel-Walsh / bootstrap-4-callouts.scss
Last active October 1, 2021 02:28
Callout SCSS rules for Bootstrap 4 #bootstrap4 #scss #css
/**
* Import Bootstrap
*/
@import "../../node_modules/bootstrap/scss/bootstrap";
/**
* Callouts
*/
@Daniel-Walsh
Daniel-Walsh / basic-post-pagination-template-part.php
Last active October 1, 2021 02:28
Basic post pagination template #wordpress #php #pagination
<?php
/**
* Pagination template part.
*
* Injects the required classes to properly render accessible pagination buttons akin to the theme. Uses Bootstrap 4 and Fontawesome.
*
* @package WordPress
*/
$paginate_classes = ' btn btn-primary btn-sm py-2 px-3 mx-1 ';