This file contains 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
// https://make.wordpress.org/core/2020/03/02/general-block-editor-api-updates/ | |
// https://github.com/WordPress/gutenberg/tree/trunk/packages/core-data | |
import { | |
PanelRow, TextControl, | |
} from '@wordpress/components'; | |
import { useSelect } from '@wordpress/data'; | |
import { useEntityProp } from '@wordpress/core-data'; | |
import { PluginDocumentSettingPanel } from '@wordpress/edit-post'; | |
import { registerPlugin } from '@wordpress/plugins'; |
This file contains 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
cat -n .zsh_history | sort -t ';' -uk2 | sort -nk1 | cut -f2- > .zhistory |
This file contains 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
<?php | |
use BitWasp\Bitcoin\Bitcoin; | |
use BitWasp\Bitcoin\Key\Deterministic\HierarchicalKeyFactory; | |
use BitWasp\Bitcoin\Key\Deterministic\HierarchicalKeySequence; | |
use BitWasp\Bitcoin\Key\Deterministic\MultisigHD; | |
use BitWasp\Bitcoin\Network\NetworkFactory; | |
use Exception; | |
/* |
This file contains 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
<?php | |
/* | |
Plugin Name: Gutenberg Audit | |
Plugin URI: http://highbrow.com.au/plugins/gutenberg-audit | |
description: What blocks is your site using? | |
Version: 0.1 | |
Author: Hugh Campbell | |
Author URI: http://highbrow.com.au/ | |
License: GPL2 | |
*/ |
This file contains 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
/* Navigate to a wordpress edit page for any post and run one of the code sections below in a javascript console to get the names/info for all blocks available to gutenberg on your site. */ | |
/* log all block info to console */ | |
console.log(wp.data.select( "core/blocks" ).getBlockTypes()); | |
/* log all block names to console */ | |
wp.data.select( "core/blocks" ).getBlockTypes().forEach(function(element) { | |
console.log(element['name']); | |
}); |
This file contains 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
# Copy all modifications to a file from one repo to another | |
for c in `git --git-dir=../path/to/repo/.git log --reverse --pretty=tformat:"%H" -- path/to/file`; do | |
git --git-dir=../path/to/repo/.git format-patch --keep-subject -1 --stdout $c | git am --3way --keep; | |
done |
This file contains 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
#!/bin/bash | |
## Installation: | |
# - make a file, called `git-rsync` in a directory, covered by your $PATH variable; | |
# - `chmod a+x` this file. | |
# - do the same for `listfiles` script | |
# | |
## Usage: | |
# 1. Syncing "dirties" (all the files you can see in the `git status` output) | |
# - before commiting, issue `git-rsync login@host:/destination/path/` command to sync all local changes to your stage server |
This file contains 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
// debug config for running project under vscode debugger | |
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"trace": true, | |
"name": "Chrome Debug", | |
"type": "chrome", | |
"request": "launch", | |
"url": "http://localhost:8000/", |
This file contains 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
Day | Name | Solution | |
---|---|---|---|
1 | Candies | https://scrimba.com/scrim/co0a64754be538039f0f7561d | |
2 | Deposit Profit | https://scrimba.com/scrim/co1634148af237abe36bd3b48 | |
3 | Chunky Monkey | https://scrimba.com/scrim/co1784708af85897a1e657e17 | |
4 | Century from year | https://scrimba.com/scrim/co2f447838bce36b29c1babf7 | |
5 | Reverse a string | https://scrimba.com/scrim/co4b84d0d934f77c4c8d0b49e | |
6 | Sort by length | https://scrimba.com/scrim/co51b4537a82ef1d8b2b8966e | |
7 | Count vowel consonant | https://scrimba.com/scrim/co8cf4a59b3a0e6fa5c12bbfa | |
8 | Rolling dice | https://scrimba.com/scrim/cob0240939633eaf66e463df8 | |
9 | Sum Odd Fibonacci Numbers | https://scrimba.com/scrim/coc994da6b0c09200edef57f3 |
This file contains 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
#!/usr/bin/env bash | |
if [ "$EUID" -ne 0 ];then | |
>&2 echo "This script requires root level access to run" | |
exit 1 | |
fi | |
if [ -z "${WORDPRESS_DB_PASSWORD}" ]; then | |
>&2 echo "WORDPRESS_DB_PASSWORD must be set" | |
>&2 echo "Here is a random one that you can paste:" |
NewerOlder