Skip to content

Instantly share code, notes, and snippets.

View FranCarstens's full-sized avatar

Francois Carstens FranCarstens

View GitHub Profile
@FranCarstens
FranCarstens / _html_entities.scss
Created January 26, 2022 14:40 — forked from apisandipas/_html_entities.scss
HTML Entities map - The pseudo-element 'content' property doesnt accept normal (») style HTML entities. These variables below easy the pain of looking up the HEX codes...
/**
* The pseudo-element 'content' property doesnt accept normal (») style
* HTML entities. These variables below easy the pain of looking up the HEX codes...
*
* Referenced from http://www.danshort.com/HTMLentities/
*
* TODO: Add all the other entities? Worth it? Some day? Maybe?
*/
// Punctuation
@FranCarstens
FranCarstens / serializeIds.js
Created March 18, 2021 18:20
A MirageJS serializer to convert all IDs to integers
// convert single string id to integer
const idToInt = id => Number(id)
// convert array of ids to integers
const idsToInt = ids => ids.map(id => idToInt(id))
// check if the data being passed is a collection or model
const isCollection = data => Array.isArray(data)
// check if data should be traversed
@FranCarstens
FranCarstens / 15MinuteIncrements.js
Created March 18, 2021 16:55
JSON Object for working with 15 minute increments over a 24 hour period
[
{ "increment":0, "startTimeValue":0, "startTime":"00:00:00.000", "endTimeValue":1459999, "endTime":"00:14:59.999" },
{ "increment":1, "startTimeValue":1500000, "startTime":"00:15:00.000", "endTimeValue":2959999, "endTime":"00:29:59.999" },
{ "increment":2, "startTimeValue":3000000, "startTime":"00:30:00.000", "endTimeValue":4459999, "endTime":"00:44:59.999" },
{ "increment":3, "startTimeValue":4500000, "startTime":"00:45:00.000", "endTimeValue":5959999, "endTime":"00:59:59.999" },
{ "increment":4, "startTimeValue":10000000, "startTime":"01:00:00.000", "endTimeValue":11459999, "endTime":"01:14:59.999" },
{ "increment":5, "startTimeValue":11500000, "startTime":"01:15:00.000", "endTimeValue":12959999, "endTime":"01:29:59.999" },
{ "increment":6, "startTimeValue":13000000, "startTime":"01:30:00.000", "endTimeValue":14459999, "endTime":"01:44:59.999" },
{ "increment":7, "startTimeValue":14500000, "startTime":"01:45:00.000", "endT