Skip to content

Instantly share code, notes, and snippets.

View cbirdsong's full-sized avatar

Cory Birdsong cbirdsong

View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active April 25, 2024 06:09
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 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; // ¯\\_(ツ)_/¯
@djsime1
djsime1 / fz_forks.md
Last active April 1, 2024 05:28
Flipper Zero firmware differences

This document has moved!

This comparison list has been relocated into the Awesome Flipper Zero repository. While you can read still read an archived version in this gist, all future updates will take place in the new repository.

Last archived version (Adapted from Nano's original messages in the Unleashed firmware Discord.)

Flipper Zero firmware differences

:: Last updated July 10 2022. ::

@dimkaram
dimkaram / advanced_circadian_lighting.yaml
Last active March 3, 2024 13:33
Homeassistant Automation Blueprint for Advanced Circadian Lighting
blueprint:
# INTRODUCTION
name: Advanced Circadian Lighting
description: >-
This automation adjusts light brightness, temperature, and color hue,
based on presence, current time and sun position.
@dwhenson
dwhenson / .stylelintrc.json
Created July 1, 2021 11:43
Stylelint Config
{
"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"]
}
@slightlyoff
slightlyoff / shortcodes_snippet.js
Created December 4, 2020 04:59
picture shortcodes
// 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)"
@tigt
tigt / git-branch-to-favicon.js
Created March 18, 2020 21:10
Creates an SVG string that can be used as a favicon across different Git branches. Actually getting this into the browser is sadly project-specific.
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)
@alexander-young
alexander-young / functions.php
Created January 15, 2020 05:27
Cleanup WordPress plugin admin
// 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)) {
@alexander-young
alexander-young / functions.php
Created January 15, 2020 02:32
Defer Javascript in WordPress
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);
@vividvilla
vividvilla / osxtweaks
Created January 8, 2020 10:45 — forked from webdevbrian/osxtweaks
Brian's List of OSX Tweaks for web developers
#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:
@seezee
seezee / webp.php
Last active November 25, 2022 22:28
WEBP for WordPress
<?php
/**
* Support for WEBP.
*
* @package myplugin
*/
// Security.
if ( ! defined( 'ABSPATH' ) ) {
die( 'Sorry, you are not allowed to access this page directly.' );