When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:
main {
max-width: 38rem;
padding: 2rem;
margin: auto;
}
// Paste these lines into website's console (Win/Linux: Ctrl + Shift + I / Mac: Cmd + Alt + I) | |
if(!!window.React || | |
!!document.querySelector('[data-reactroot], [data-reactid]') || | |
Array.from(document.querySelectorAll('*')).some(e => e._reactRootContainer !== undefined || Object.keys(e).some(k => k.startsWith('__reactContainer'))) | |
) | |
console.log('React.js'); | |
if(!!document.querySelector('script[id=__NEXT_DATA__]')) | |
console.log('Next.js'); |
// ==UserScript== | |
// @name RedaddCSS | |
// @namespace com.digitalfishfun.nosteponcss | |
// @version 1 | |
// @grant none | |
// @include https://reddit.com/r/* | |
// ==/UserScript== | |
const nosteponcss_instructions = ` | |
USAGE: |
<?php | |
$this->respond( | |
'/?', function ($req, $res, $service, $app) { | |
return "home page for SUBDOMAIN"; | |
} | |
); |
const hoverTime = 400 | |
const fetchers = {} | |
const doc = document.implementation.createHTMLDocument('prefetch') | |
function fetchPage (url, success) { | |
const xhr = new XMLHttpRequest() | |
xhr.open('GET', url) | |
xhr.setRequestHeader('VND.PREFETCH', 'true') | |
xhr.setRequestHeader('Accept', 'text/html') | |
xhr.onreadystatechange = () => { |
<?php | |
function json_response(int $code = 200, array $data = null) | |
{ | |
// clear the old headers | |
header_remove(); | |
// set the actual code | |
http_response_code($code); | |
// set the header to make sure cache is forced | |
header('Cache-Control: public, max-age=300'); |
These functions use one or two 'base' colors to automatically generate a color range similar to Material Design's color ranges. Useful to quickly get different shades of your primary brand color or accent color, or to generate a set of neutrals between hand-selected light and dark colors.
$greens: make-shades(#cc99cc);
// (
// 100: #eeddee,
// 200: #ddbbdd,