A userstyle that makes you wait ten seconds before entering a Hacker News thread. I use stylus to manage mine.
.subtext {
display: inline-block;
background: linear-gradient(to left, transparent 50%, #f60 50%) right;
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
(() => { | |
const SHOW_SIDES = false; // color sides of DOM nodes? | |
const COLOR_SURFACE = true; // color tops of DOM nodes? | |
const COLOR_RANDOM = false; // randomise color? | |
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
const THICKNESS = 20; // thickness of layers | |
const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
A userstyle that makes you wait ten seconds before entering a Hacker News thread. I use stylus to manage mine.
.subtext {
display: inline-block;
background: linear-gradient(to left, transparent 50%, #f60 50%) right;
// Inspired by https://twitter.com/coderitual/status/1112297299307384833 and https://tapajyoti-bose.medium.com/7-killer-one-liners-in-javascript-33db6798f5bf | |
// 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))); | |
// or | |
const sleep = util.promisify(setTimeout); |
(function (context, trackingId, options) { | |
const history = context.history; | |
const doc = document; | |
const nav = navigator || {}; | |
const storage = localStorage; | |
const encode = encodeURIComponent; | |
const pushState = history.pushState; | |
const typeException = 'exception'; | |
const generateId = () => Math.random().toString(36); | |
const getId = () => { |
{# | |
// lazyLoaded Image/bgImages, optimized with Imager and Focuspoint | |
--------------------------------------------------------------------------- | |
https://nystudio107.com/blog/creating-optimized-images-in-craft-cms | |
https://github.com/aelvan/Imager-Craft | |
https://github.com/smcyr/Craft-FocusPoint | |
for the bgImage intrinsic ratio classname creation check: | |
https://github.com/inuitcss/inuitcss/blob/develop/objects/_objects.ratio.scss |
{# | |
// lazyLoaded Image/bgImages, optimized with Imager and Focuspoint | |
--------------------------------------------------------------------------- | |
https://github.com/aelvan/Imager-Craft | |
https://github.com/smcyr/Craft-FocusPoint | |
for the bgImage intrinsic ratio classname creation check: | |
https://github.com/inuitcss/inuitcss/blob/develop/objects/_objects.ratio.scss | |
https://github.com/constancecchen/object-fit-polyfill |
{# ================================================================== #} | |
{# Responsive Image Macro | |
{# ================================================================== #} | |
{# | |
Macro to centralize the markup and config for responsive images. | |
Based on an article by Marion Newlevant (@marionnewlevant) and | |
adapted for the Lazysizes plugin. Read more: | |
https://straightupcraft.com/articles/responsive-images-with-twig-macros |
Updated: Just use qutebrowser (and disable javascript). The web is done for.
{ | |
// http://eslint.org/docs/rules/ | |
"ecmaFeatures": { | |
"binaryLiterals": false, // enable binary literals | |
"blockBindings": false, // enable let and const (aka block bindings) | |
"defaultParams": false, // enable default function parameters | |
"forOf": false, // enable for-of loops | |
"generators": false, // enable generators | |
"objectLiteralComputedProperties": false, // enable computed object literal property names |
<?php
if(isset($_POST['submit'])){
$name = htmlspecialchars(stripslashes(trim($_POST['name'])));
$subject = htmlspecialchars(stripslashes(trim($_POST['subject'])));
$email = htmlspecialchars(stripslashes(trim($_POST['email'])));
$message = htmlspecialchars(stripslashes(trim($_POST['message'])));
if(!preg_match("/^[A-Za-z .'-]+$/", $name)){