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
// 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; // ¯\\_(ツ)_/¯ |
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
<?php | |
/** | |
* Optimize Content Hero Image WordPress Plugin. | |
* | |
* @package OptimizeContentHeroImage | |
* @author Weston Ruter, Google | |
* @license GPL-2.0-or-later | |
* @copyright 2023 Google Inc. | |
* | |
* @wordpress-plugin |
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
blueprint: | |
# INTRODUCTION | |
name: Advanced Circadian Lighting | |
description: >- | |
This automation adjusts light brightness, temperature, and color hue, | |
based on presence, current time and sun position. | |
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
{ | |
"plugins": ["stylelint-order", "stylelint-scss"], | |
"defaultSeverity": "warning", | |
"rules": { | |
"at-rule-empty-line-before": [ | |
"always", | |
{ | |
"except": ["blockless-after-same-name-blockless", "first-nested"], | |
"ignore": ["after-comment", "first-nested", "blockless-after-same-name-blockless"] | |
} |
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
// Phil Hawksworth's Netlify LMS <picture> img generator | |
let getPicture = (url, alt="Missing alt text", width, height, style) => { | |
let w = width ? width : "500"; | |
let w_attr = width ? `width="${width}"` : ""; | |
let h_attr = height ? `height="${height}"` : ""; | |
let s_attr = style ? `style="${style}"` : ""; | |
return `<picture> | |
<source | |
media="(min-width: 1200px)" |
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
const { execSync } = require('child_process') | |
const { createHash } = require('crypto') | |
const invertColor = require('invert-color') | |
const branchName = execSync('git rev-parse --abbrev-ref HEAD') | |
const hash = createHash('sha256') | |
hash.update(branchName) | |
const color = '#' + hash.digest().toString('hex').substring(0, 6) | |
const invertedColor = invertColor(color, true) |
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
// Removing plugin controls from admin | |
function remove_plugin_controls($actions, $plugin_file, $plugin_data, $context){ | |
if (array_key_exists('edit', $actions)) { | |
unset($actions['edit']); | |
} | |
if (array_key_exists('deactivate', $actions)) { |
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
function defer_parsing_of_js($url) | |
{ | |
if (is_admin()) return $url; //don't break WP Admin | |
if (false === strpos($url, '.js')) return $url; | |
if (strpos($url, 'jquery.js')) return $url; | |
return str_replace(' src', ' defer src', $url); | |
} | |
add_filter('script_loader_tag', 'defer_parsing_of_js', 10); |
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
#OSX Tweaks: | |
=========== | |
- Most need reboot to show changes | |
- Most of these tweaks are just for speed, but some are specific for development | |
- All of these are to be ran in terminal. The commands to be copy and pasted start after the less-than sign. | |
- I'm not responsible for any adverse effects to your computer, at all. | |
##Increase the speed of OS X dialogs boxes: |
NewerOlder