Skip to content

Instantly share code, notes, and snippets.

View m-e-h's full-sized avatar
😐
...

Marty Helmick m-e-h

😐
...
View GitHub Profile
@m-e-h
m-e-h / maybe-motion-light.yaml
Last active December 12, 2022 19:59
motion maybe turn on lights for a bit
blueprint:
name: Motion-activated Light
description: Turn on a light when motion is detected.
domain: automation
source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/motion_light.yaml
input:
motion_entity:
name: Trigger Sensor
selector:
entity:
@m-e-h
m-e-h / webpsrcset.php
Created July 21, 2021 13:29
Adds a webp image to the srcset if available in the media-library.
<?php
/**
* Adds a webp image to the srcset if available in the media-library.
*
* @param string $post_id
* @param array $args
* @return string — Image markup.
*/
function abe_get_picture_source( $post_id = 0, $args = [] ): string {
$post_id = $post_id ?: get_the_ID();
/**
* External Dependencies
*/
// import classnames from 'classnames';
/**
* WordPress Dependencies
*/
import { addFilter } from '@wordpress/hooks';
import { Fragment } from '@wordpress/element';
*,
::before,
::after {
box-sizing: border-box;
background-repeat: no-repeat;
color: inherit;
font-size: inherit;
font-weight: inherit;
font-family: inherit;
line-height: inherit;
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true
#indent_size = 4
@m-e-h
m-e-h / createOrderedCSSStyleSheet.js
Created January 25, 2019 13:32 — forked from necolas/createOrderedCSSStyleSheet.js
OrderedCSSStyleSheet: control the insertion order of CSS
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
*/
type Groups = { [key: number]: Array<string> };
@m-e-h
m-e-h / block-editor-page.html
Last active January 10, 2019 22:50
WP Block Test Data
<!-- wp:heading -->
<h2>You're looking at an (H2)</h2>
<!-- /wp:heading -->
<!-- wp:heading {"level":3} -->
<h3>You're looking at an (H3)</h3>
<!-- /wp:heading -->
<!-- wp:heading {"level":4} -->
<h4>You're looking at an (H4)</h4>
@m-e-h
m-e-h / build_block-library_style.css
Created November 12, 2018 20:05
Gutenberg front-end stylesheet speceficity audit
@keyframes fade-in {
0% {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes editor_region_focus {
0% {
@m-e-h
m-e-h / disarray.php
Created June 19, 2018 21:17
Gravity forms field array/string to array
<?php
$string = $gv_entry->entry['30'];
// Remove brackets.
$string = trim( $string, '[]' );
$post_ids = array_map(
function( $string_id ) {
// Remove quotes around IDs.
@m-e-h
m-e-h / .zshrc
Last active October 22, 2022 19:15
Linux(Ubuntu) Fresh Install
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
export ZSH="/home/marty/.oh-my-zsh"
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(status custom_meh dir vcs)
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_RPROMPT_ON_NEWLINE=true
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
POWERLEVEL9K_CUSTOM_MEH="echo '\uf11a' meh"