- View: Also called a "template", a file that contains markup (like HTML) and optionally additional instructions on how to generate snippets of HTML, such as text interpolation, loops, conditionals, includes, and so on.
- View engine: Also called a "template library" or "templater", ie. a library that implements view functionality, and potentially also a custom language for specifying it (like Pug does).
- HTML templater: A template library that's designed specifically for generating HTML. It understands document structure and thus can provide useful advanced tools like mixins, as well as more secure output escaping (since it can determine the right escaping approach from the context in which a value is used), but it also means that the templater is not useful for anything other than HTML.
- String-based templater: A template library that implements templating logic, but that has no understanding of the content it is generating - it simply concatenates together strings, potenti
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
/* | |
* @param String | |
* Using built-in methods, return true if a given string is a palindrome. | |
**/ | |
function palindrome(str) { | |
const invalid = /[\W]/g; | |
const normalized = str.toLowerCase().replace(invalid, ''); | |
const reversed = normalized.split('').reverse().join(''); | |
return normalized === reversed; |
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
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"defaultProfile": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}", | |
"copyOnSelect": true, | |
"copyFormatting": false, | |
"profiles": | |
{ | |
"defaults": | |
{ |
I hereby claim:
- I am gidhon on github.
- I am gidhon (https://keybase.io/gidhon) on keybase.
- I have a public key ASCh5-nkgYd67C60GxOj7V8HziFlnQ6dKNO7oihYgqdXTQo
To claim this, I am signing this object:
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
'.source.stylus': | |
'Set size: 2D (equilateral | [width, height])': | |
prefix: 'size' | |
body: 'size($1px)' | |
'Unit conversion: px ⟶ rem': | |
prefix: 'rem' | |
body: 'rem($0px)' | |
'@media: min-width': | |
prefix: 'Platframe: min-width' | |
body: '+min($1)' |
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
{ | |
"Set size: 2D (equilateral | [width, height])":{ | |
"prefix":[ | |
"Platframe | size (both [w, h])", | |
"size" | |
], | |
"body":[ | |
"size($0px)" | |
], | |
"description":"Set the width and height of an element" |
You have made some commits, pushed it upstream to the remote branch, then realized that some or all of those commits must for some reason not be included. In example, accidently commiting large multimedia files (blobs) that will forever bloat the commit history of the branch.
- ensure all changes are commited in your current, "faulty" branch
- switch to your master branch
git checkout master
- update master with latest changes on remote
A Stylus mixin for linear gradients with support for comma-separated splat arguments. In part created as a work-around / abstraction for this.
The method for retrieving the fall-back background colour can do with some improvement, such as averaging the colours or selecting a colour by means of passing an additional argument.
View it on CodePen