Skip to content

Instantly share code, notes, and snippets.

View aduth's full-sized avatar

Andrew Duthie aduth

View GitHub Profile
@aduth
aduth / input.scss
Created December 13, 2022 15:52
Generated by SassMeister.com.
// USWDS:
%block-input-styles {
margin-top: 0.5rem;
}
// ...
// LGDS:
%block-input-styles {
margin-top: 0.25rem;
@aduth
aduth / input.scss
Created May 13, 2022 14:51
Generated by SassMeister.com.
.usa-radio__input--tile:disabled + .usa-radio__label--illustrated,
.usa-checkbox__input--tile:disabled + .usa-checkbox__label--illustrated {
.usa-radio__image,
.usa-checkbox__image {
filter: invert(45%) sepia(1%) saturate(0%) hue-rotate(232deg) brightness(100%) contrast(80%);
}
}
.usa-radio__input--tile:disabled + .usa-radio__label--illustrated .usa-radio__image,
.usa-checkbox__input--tile:disabled + .usa-checkbox__label--illustrated .usa-checkbox__image {
@aduth
aduth / stars-block.php
Last active February 15, 2022 04:13
Vue Custom Element Gutenberg Block
<?php
// NOTE: It would normally be recommended to split a block's JavaScript
// implementation to a separate file, but is authored here in a single
// file for convenience's sake.
//
// See: https://github.com/WordPress/gutenberg/pull/2791
/**
* Plugin Name: Stars Block
@aduth
aduth / flag.svg
Last active July 14, 2021 15:04
US Flag
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aduth
aduth / gitrebasebranch.sh
Created February 11, 2020 17:05
Git - Interactive rebase against own merge base
#!/bin/bash
git rebase -i $(git merge-base HEAD master)
@aduth
aduth / babel.config.js
Created August 8, 2020 18:28
Alternative Node Main Entrypoint with Babel (babel-plugin-module-resolver)
const { join } = require('path');
module.exports = {
plugins: [
[
'module-resolver',
{
root: ['./packages'],
alias: {
'^@my-scope\\/([^/]+)$': (match) => {
@aduth
aduth / index.js
Last active March 14, 2020 19:34
Snowpack Strict + "type: module" incompatibility
import log from './log.js';
log();
@aduth
aduth / stars-block.js
Last active July 12, 2019 18:58 — forked from pento/stars-block.js
Gutenberg Stars Block
( function( blocks, element ) {
var el = element.createElement;
function Stars( { stars } ) {
return el( 'div', { key: 'stars' },
'★'.repeat( stars ),
( ( stars * 2 ) % 2 ) ? '½' : '' );
}
blocks.registerBlockType( 'stars/stars-block', {
const { get } = require( 'https' );
const { parse } = require( 'url' );
const pulls = [
'https://github.com/WordPress/gutenberg/pull/14003',
'https://github.com/WordPress/gutenberg/pull/14469',
'https://github.com/WordPress/gutenberg/pull/14475',
'https://github.com/WordPress/gutenberg/pull/14681',
'https://github.com/WordPress/gutenberg/pull/14693',
'https://github.com/WordPress/gutenberg/pull/14711',
@aduth
aduth / get-merge-commits.js
Created April 15, 2019 14:46
Generate cherry-pick commands from a set of pull requests
const { get } = require( 'https' );
const { parse } = require( 'url' );
const pulls = [
'https://github.com/WordPress/gutenberg/pull/14003',
'https://github.com/WordPress/gutenberg/pull/14469',
'https://github.com/WordPress/gutenberg/pull/14475',
'https://github.com/WordPress/gutenberg/pull/14681',
'https://github.com/WordPress/gutenberg/pull/14693',
'https://github.com/WordPress/gutenberg/pull/14711',