-
This implies that code using
mbstring.func_overload
is incompatible with practically all other code, which is written under the assumption that basic string operations work normally.
This file contains hidden or 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
/** | |
* Test if a string is a valid email address | |
* using the constraint validation API, rather | |
* than unwieldy regular expressions | |
* | |
* @param {string} value | |
* @returns {boolean} | |
*/ | |
const validateEmail = value => Object.assign( | |
document.createElement('input'), |
This file contains hidden or 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
/** | |
* Simple polyfill for the loading="lazy" image attribute | |
* based on gandalf458's idea @ https://tinyurl.com/ya2wlg93 | |
*/ | |
document.addEventListener('DOMContentLoaded', function () { | |
if ('loading' in HTMLImageElement.prototype) { | |
return | |
} | |
var images = Array.prototype.map.call( |
This file contains hidden or 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
# Hello. This is a commant, and as such | |
# getting ignored by the interpreter | |
# Types I -- Primitives | |
1 # This is an integer (int) | |
1.1 # This is a float (float) | |
"blah" # This is a string (str ) | |
True # This is a boolean (bool) | |
None # This is not anything (NoneType) |
This file contains hidden or 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
{ | |
"name": "transduce", | |
"version": "0.1.0", | |
"main": "transduce.js", | |
"license": "MIT", | |
"author": { | |
"name": "m3g4p0p" | |
} | |
} |
This file contains hidden or 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
export class Validator { | |
/** | |
* @param {string|object} constraints | |
*/ | |
constructor (constraints) { | |
/** | |
* @member {HTMLInputElement} | |
* @private | |
*/ | |
this.input = Object.assign( |
This file contains hidden or 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
/** | |
* This class will encapsulate the lazy loading logic. | |
* | |
* We're going to implement it the old-fashioned way using a | |
* scroll event listener, rather than the new Intersection | |
* Observer API; however we will take special care of common | |
* performance issues with this approach. | |
* | |
* Feel free to use this piece of code in production. :-) | |
* |
This file contains hidden or 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 $ = (selector, context = document) => context.querySelector(selector) | |
const $$ = (selector, context = document) => context.querySelectorAll(selector) |
This file contains hidden or 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
<h1>bar</h1> |
This file contains hidden or 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
#!/bin/sh | |
name=$1 | |
if [[ $2 ]] | |
then | |
cd $1 | |
name=$2 | |
fi |