This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Test Date Parsing</title> | |
</head> | |
<body> | |
<?php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dumb helpers functions | |
/** | |
* Generates a random integer between a min and max value | |
* @sauce https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random#getting_a_random_integer_between_two_values | |
* @param number min | |
* @param number max | |
* @return number | |
*/ | |
function randomInt(min, max) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @sauce: https://getbootstrap.com/docs/4.4/getting-started/accessibility/#visually-hidden-content | |
.sr-only | |
position: absolute | |
width: 1px | |
height: 1px | |
padding: 0 | |
margin: -1px | |
overflow: hidden | |
clip: rect(0,0,0,0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
import Container from './Container.svelte' | |
</script> | |
<h1>App Name</h1> | |
<Container> | |
<div class:col-xs-3 class:col-md-2 class:col-lg-1>...</div> | |
<div class:col-xs-3 class:col-md-2 class:col-lg-1 class:hidden class:visible-md>...</div> | |
<div class:col-xs-3 class:col-md-2 class:col-lg-1>...</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sorts a collection of objects based on a pipe-delimited list of sorting parameter config strings | |
* @param {array} collection Collection of objects | |
* @param {string} sortKeys Pipe separated string of sortable properties within the collection model and it's sort priorities: | |
* @param {string} invertCollection invert collection sort | |
* | |
* @schema sortKeys: '(string)keyName:(string)keyType:(string)invert|...' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SELECTOR = 'span, p, b, a' | |
document.querySelectorAll(SELECTOR) | |
.forEach(el => { | |
el.innerText = el.innerText.replace(/l|r/gm, 'w'); | |
return el | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Memoizes a given set of data and returns if a result has been cached or not | |
* @param array $params Config for what to memoize | |
* @param (any) $data (optional) Data we wish to memoize | |
* @return any [description] | |
*/ | |
function memoize($key, $data=null) { | |
$db = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// keycode constants | |
const SPACE = 32 | |
const PAGE_UP = 33 | |
const PAGE_DOWN = 34 | |
const NUM_PLUS = 107 | |
const NUM_MINUS = 109 | |
// UI constants | |
const RATIO = { w: 4, h:3 } | |
const SCREEN = { w: 0, h: 0 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ZIPCODES = require('./zipcodes.js') | |
const sqlite = require('sqlite') | |
const Promise = require('bluebird') | |
// http://www.zipcodeapi.com/API | |
/** | |
* Calculates distance between two ZIPCODES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Storage API helper method that sets a key/value in specified storage API with | |
* an optional cache duration in minutes | |
* @private | |
* @sauce https://developer.mozilla.org/en-US/docs/Web/API/Storage/setItem | |
* | |
* @param {object} StorageAPI Storage API object to use for .getItem() calls | |
* @param {string} key A DOMString containing the name of the key you want to create/update | |
* @param {any} value The value you want to give the key you are creating/updating | |
* @param {integer} durationInMinutes The time in minutes the item should be valid for, used for passively expiring cache |
NewerOlder