| Command | Description | Example |
|---|---|---|
parallel echo ::: A B C |
🔤 Process items in parallel | Output: A, B, C (in any order) |
parallel echo {} ::: *.txt |
🔍 Use {} as placeholder | Echoes names of all .txt files |
cat file.txt | parallel echo |
📥 Read input from stdin | Processes each line of file.txt |
parallel -j4 command ::: item1 item2 item3 |
🔢 Limit to 4 jobs at a time | Runs 'command' on items, max 4 parallel |
This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.
| Description | Syntax |
|---|---|
| Get the length of a string | ${#VARNAME} |
| Get a single character | ${VARNAME[index]} |
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
| # | |
| # Quicksilver configuration file | |
| # | |
| # Requirements: | |
| # - Terminus Quicksilver plugin: https://github.com/pantheon-systems/terminus-quicksilver-plugin) | |
| # | |
| # Copy to $HOME/.quicksilver/quicksilver.yml | |
| # | |
| # To create your own repository with installable examples: | |
| # |
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
| <?php | |
| add_filter( 'comments_open', '__return_false' ); | |
| add_action( 'admin_menu', function(){ | |
| global $menu; | |
| // Remove Comments | |
| if ( isset( $menu[25] ) ) { | |
| unset( $menu[25] ); | |
| } |
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
| <?php | |
| add_action( 'admin_bar_menu', function( $wp_admin_bar ) { | |
| $screen = get_current_screen(); | |
| if ( is_a( $screen, 'WP_Screen' ) ) { | |
| $wp_admin_bar->add_node( [ | |
| 'id' => 'screen_id', | |
| 'title' => sprintf( __( 'Screen ID: <kbd style="font-family: monospace; font-weight: 900;">%s</kbd>' ), esc_html( $screen->id ) ), | |
| ] ); |
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
| <?php | |
| namespace DeliciousBrains\Admin; | |
| use DeliciousBrains\DBI; | |
| class ACF { | |
| public function init() { | |
| add_filter( 'acf/settings/save_json', array( $this, 'get_local_json_path' ) ); |
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
| #!/usr/bin/env bash | |
| PRIMARY_LOCATION=~/Development | |
| SECONDARY_LOCATION=/Volumes/Macintosh\ HD/Development | |
| BROWSER= | |
| CLOPS= | |
| VERBOSE=true | |
| SHOWHELP=false | |
| SCHEME=http: |
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
| <?php | |
| /** | |
| * Update a specific site from 'http://' to 'https://'. | |
| * | |
| * Only touches the 'home' and 'siteurl' options. | |
| * Depending on plugins, etc., you may need to update other options too. | |
| * | |
| * Run on WordPress multisite with: | |
| * | |
| * wp site list --field=url | xargs -I % wp eval-file http-to-https.php --url=% |
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
| #!/usr/bin/env bash | |
| set -e | |
| if [ ! -d src/amazon-s3-and-cloudfront ]; then | |
| echo 'This script must be run from the repository root.' | |
| exit 1 | |
| fi | |
| for PROG in composer find sed |
NewerOlder