Skip to content

Instantly share code, notes, and snippets.

View kmwalsh's full-sized avatar
🤖

Kate Walsh kmwalsh

🤖
View GitHub Profile
@kmwalsh
kmwalsh / gist:863415ac6b9efa8f9e69ff2557c7cbbf
Last active June 29, 2023 18:21
Official guide to seriously official development slang
yeet = deploy. Use example: let’s yeet this to production.
yolo = do it on live. Use example: I’ma yolo that change – no staging.
yoinked/yoinkerized = pulled repo. Use example: I'ma yoinkerize the latest changes from main.
glow up = redesign. Use example: Their site is from 2010, needs a total glow up.
snack = clever piece of code. Use example: That function you wrote is a lil snack.
alias install-wp="curl -0 https://wordpress.org/latest.zip > latest.zip && unzip latest.zip && mv wordpress/* ./ && rm latest.zip && rm -r wordpress"
https://drewdevault.com/2018/07/02/Email-driven-git.html
Date: Mon, 11 Jun 2018 14:19:22 -0400
From: Drew DeVault <[email protected]>
To: Gregory Mullen <omitted>
Subject: Re: [PATCH 2/3 todo] Filter private events from events feed
On 2018-06-11 9:14 AM, Gregory Mullen wrote:
> diff --git a/todosrht/alembic/versions/cb9732f3364c_clear_defaults_from_tickets_to_support_.py b/todosrht/alembic/versions/cb9732f3364c_clear_defaults_from_tickets_to_support_.py
> -%<-
@kmwalsh
kmwalsh / yeet
Last active March 24, 2023 00:27
offload (yeet) "which front end build tool was it again?" from brain forever
#!/bin/bash
buildTools=("gulp", "gulp watch", "grunt", "grunt watch", "npm run build", "npm run watch", "npx webpack")
for t in ${buildTools[@]};
do
$t
echo yeet $t
done
@kmwalsh
kmwalsh / gist:40728e77d88b7fb2d9a0fd048d564c23
Created August 12, 2022 21:18
self-updating modified plugin
#!/bin/bash
# copy patches and update.sh to temporary directory
cp -r ./patches ~/tmp/wp-security-audit-log
cp -r ./update.sh ~/tmp/wp-security-audit-log
# get latest and unzip
curl -O https://downloads.wordpress.org/plugin/wp-security-audit-log.latest-stable.zip
unzip wp-security-audit-log.latest-stable.zip
@kmwalsh
kmwalsh / gist:47f65c2d8790ff914f45cd7866c1859f
Created July 19, 2021 23:04
px to em with rem support
@function em($pixels, $context: 16) {
@if ( comparable($pixels, 1px)) {
@if (unitless($pixels)) {
$pixels: $pixels * 1px;
}
@if (unitless($context)) {
$context: $context * 1px;
}
@return $pixels / $context * 1em;
}
// fix for keyboard focus states on scroll position or timed based popup implementations
//
// forces the focus back to the element that was focused prior to popup open
// fixes focus bug when faking a click on existing element to bring up a modal window
// fixes accessibility issue where the user's focus was changed when the popup shows
//
/**
* Gets keyboard-focusable elements within a specified element
* @param {HTMLElement} [element=document] element
/**
*
* Prerequisites:
* (1) All of your Gutenberg block Sass is in its own folder, or somewhere separated from the rest of your Sass. `components/blocks/*` is the location of the Sass in this example.
* (2) Your variables, mixins, functions, etc. are separated from the rest of your sass. Mixin/variables/function files DO NOT CONTAIN any styling whatsoever -- just definitions.
* (3) Do not use the class wp-block anywhere in your custom Gutenblock templates.
*
* Steps:
* 1. Create a new file, editor-style.scss, alongside your style.scss -- do not use an underscore to start filename as this is not a partial
* 2. Import your block Sass, your mixins, variables, and functions, as well as any external libraries, in patterns shown below
/**
* Redirect single of CPT to page
*/
if ( ! function_exists('kw_redirect_resource') ) {
add_action( 'template_redirect', 'kw_redirect_resource' );
function shnj_redirect_resource() {
if ( is_singular( 'CUSTOM_POST_TYPE_NAME' ) ) :
//get the url by path
<h1>H1 heading Medium length headline<h1>
<h2>H2 heading Medium length headline</h2>
<h3>H3 heading Medium length headline</h3>
<h3 class="heading--alternative">H3 heading Medium length headline</h3>
<h4>H4 heading Medium length headline</h4>
<h5>H5 heading Medium length headline</h5>
<h6>H6 heading Medium length headline</h6>
<a href="#">Hello i am a link</a> Lorem ipsum dolor sit amet, consectetur adipiscing elit. In consectetur sapien ut sem auctor, id suscipit orci auctor. Nullam nec consequat magna. Aliquam vulputate condimentum sem vitae imperdiet. Duis dignissim ligula quis ligula aliquam, in dapibus sapien auctor.