Skip to content

Instantly share code, notes, and snippets.

View renatonascalves's full-sized avatar
🇧🇷

Renato Alves renatonascalves

🇧🇷
View GitHub Profile
@renatonascalves
renatonascalves / gutenberg-helpers.js
Created December 19, 2023 17:15 — forked from KevinBatdorf/gutenberg-helpers.js
WordPress check Gutenberg editor is ready
import { select, subscribe } from '@wordpress/data'
export function whenEditorIsReady() {
return new Promise((resolve) => {
const unsubscribe = subscribe(() => {
// This will trigger after the initial render blocking, before the window load event
// This seems currently more reliable than using __unstableIsEditorReady
if (select('core/editor').isCleanNewPost() || select('core/block-editor').getBlockCount() > 0) {
unsubscribe()
resolve()
@renatonascalves
renatonascalves / bulk-transfer-gh-issues.sh
Created December 1, 2023 19:04 — forked from slaFFik/bulk-transfer-gh-issues.sh
Open local repo to bulk transfer all its issues to a new repo: https://jloh.co/posts/bulk-migrate-issues-github-cli/
gh issue list -s all -L 500 --json number | \
jq -r '.[] | .number' | \
xargs -I% gh issue transfer % https://github.com/<destination repo>
@renatonascalves
renatonascalves / php-upgrades.md
Created September 28, 2023 11:17 — forked from mindplay-dk/php-upgrades.md
PHP upgrades

Upgrading PHP

Guidelines for upgrading the minimum PHP version requirements of packages and projects.

This isn't meant to be an exhaustive guide to upgrading, but as a checklist for the most important upgrades.

PHP 5.3

The first version to support namespaces - any relevant PHP packages/projects usually have this version as the minimum requirement, so this document won't concern itself with upgrades prior to that.

@renatonascalves
renatonascalves / slope_vs_starting.md
Created February 24, 2023 23:54 — forked from gtallen1187/slope_vs_starting.md
A little bit of slope makes up for a lot of y-intercept

"A little bit of slope makes up for a lot of y-intercept"

01/13/2012. From a lecture by Professor John Ousterhout at Stanford, class CS140

Here's today's thought for the weekend. A little bit of slope makes up for a lot of Y-intercept.

[Laughter]