Download Flutter SDK, extract the "Flutter" folder and put somewhere on your machine https://flutter.dev/docs/get-started/install
Add path for 'location/flutter/bin'
// Stolen from https://stackoverflow.com/a/31615643 | |
const appendSuffix = n => { | |
var s = ['th', 'st', 'nd', 'rd'], | |
v = n % 100; | |
return n + (s[(v - 20) % 10] || s[v] || s[0]); | |
}; | |
module.exports = function dateFilter(value) { | |
const dateObject = new Date(value); |
/* *********************************************** | |
Styles for Mastodon | |
Adapted from different sources | |
- https://write.as/panais/styles-pour-mastodon-avec-stylus | |
- https://mastodon.social/@matuzo/109284559864791077 | |
- https://mastodon.social/@matuzo/109284628517006156 | |
- https://gist.github.com/justmarkup/e4f6d52bef604e170815aaf44f459fbc | |
*********************************************** */ |
Download Flutter SDK, extract the "Flutter" folder and put somewhere on your machine https://flutter.dev/docs/get-started/install
Add path for 'location/flutter/bin'
// By @coderitual | |
// https://twitter.com/coderitual/status/1112297299307384833 | |
// Remove any duplicates from an array of primitives. | |
const unique = [...new Set(arr)] | |
// Sleep in async functions. Use: await sleep(2000). | |
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms))); | |
// Type this in your code to break chrome debugger in that line. |
/** | |
* Animated line headings | |
*/ | |
h1 { | |
display: flex; | |
align-items: center; | |
width: 100%; | |
box-sizing: border-box; |
<button aria-pressed="false" aria-label="Toggle something">I'm a toggle button!</button> | |
<button aria-checked="false" role="switch" aria-label="Switch something">I'm a switch!</button> |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
<article>article</article> | |
<aside>aside</aside> |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style> | |
input.broken { | |
/* border: 2px solid; */ | |
/* border-width: 2px; */ |