This file contains hidden or 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
import { subscribe, select } from '@wordpress/data'; | |
import { registerBlockStyle } from '@wordpress/blocks'; | |
/** | |
* @typedef {Object} BlockStyle | |
* @description The block style options, or an array of styles to register. Equivalent to `wp.blocks.registerBlockStyle` | |
* @property {string} name The slug of the block style | |
* @property {string} label The label of the block style | |
*/ |
This file contains hidden or 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
.row { | |
--column-count: 12; | |
--grid-gap-width: 16px; | |
--column-base-min-width: calc((var(--width-grid) - (var(--column-count) - 1) * var(--grid-gap-width)) / var(--column-count)); | |
display: flex; | |
flex-flow: column; | |
gap: var(--grid-gap-width); | |
@media (--bp-medium) { | |
display: grid; |
This file contains hidden or 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
// ==UserScript== | |
// @name WordPress Developer Docs - In-Page Navigation Anchors | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Adds a sticky table of contents to the sidebar that contains anchor links to in-page sections when on developer.wordpress.org | |
// @author Gabriel Rose (@roseg43) | |
// @match https://developer.wordpress.org/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=wordpress.org | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or 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
(() => { | |
/** | |
* Renders a button that when clicked copies the NodeList passed to the constructor to the clipboard | |
* | |
* @param [NodeList] content - a NodeList of selected elements | |
*/ | |
const CopyToClipBoardBtn = (content) => { | |
const btn = document.createElement('button'); | |
btn.innerText = 'Copy to clipboard'; |
This file contains hidden or 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
/** | |
* Basic Flex Grid | |
* ---------------- | |
* This is a simple flex grid I've been using on a lot of projects. It supports both | |
* flexible grids as well as rigid column grids. While this is currently designed for internal use | |
* (it uses flexbox mixins because our build pipeline doesn't support autoprefixer yet), it's not too difficult | |
* to use in your own projects. Simply replace the flexbox mixins with their relevant rules, and you'll be good | |
* to go. | |
* @author Gabe Rose <https://gist.github.com/roseg43> | |
**/ |
This file contains hidden or 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
// HTML Label plugin | |
Chartist.plugins = Chartist.plugins || {}; | |
Chartist.plugins.ctHtmlLabels = function(options) { | |
return function(chart) { | |
chart.on('draw', function(context) { | |
if (context.type === 'label') { | |
// Best to combine with something like sanitize-html | |
context.element.empty()._node.innerHTML = context.text; | |
} | |
}); |
This file contains hidden or 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
import os, re, sys | |
print ("Asset Renamer v1 ::::::::::::::") | |
def replaceVersionsInFile(file): | |
#This regex matches all href and src attributes and finds version strings that either use question marks of the unicode string %3 | |
pattern = "(?:href=[\"\']?([^\"\'>]+)[\"\']?|src=[\"\']?([^\"\'>]+)[\"\']?)([\']?(?=.*%3?)[^\"\']*)|(.*(?=.*\?)[^\"\']*)" | |
fo = open(file, 'r+'); | |
text = fo.readlines() | |
fo.seek(0) | |
fo.truncate() | |
for line in text: |
This file contains hidden or 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 ($) { | |
// An array of presentationTimeslots | |
var slots = []; | |
function presentationTimeslot(el) { | |
// So that we always have a global object scope that can't be tainted by local scopes | |
var self = this; | |
this.$el = $(el); | |
this.$parentTable = this.$el.parents('table'); |
NewerOlder