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
| # Force Claude to open in the root folder of a project | |
| # | |
| # Claude annoying treats the folder it was launched from as the project root. If the root is ~/local-sites/core/ | |
| # and that's where the CLAUDE.md file is, but you launch claude from ~/local-sites/core/app/public/wp-content or | |
| # ~/local-sites/core/app/public/wp-content/mu-plugins, then it'll created .claude/settings.local.json files in | |
| # those subdirectories, and have separate conversation history from each other and from the project root. | |
| # | |
| # This scans for a CLAUDE.md at the project root and launches claude from there. $HOME also has a global CLAUDE.md, | |
| # though, so this stops before that, to avoid $HOME being treated as a project root. | |
| # |
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 AdminScreenItems; | |
| add_action( 'admin_init', __NAMESPACE__ . '\register_admin_screen_items_callback' ); | |
| /** | |
| * Register set_minimum_number_admin_screen_items to all admin screens. | |
| * | |
| * It's necessary to manually add it for each screen name because WP_Screen::render_per_page_options |
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
| // ⚠️ I have not verified that this is secure; I just cleaned it up to try it out. | |
| // Use at your own risk. I ended up using https://www.npmjs.com/package/@automattic/generate-password instead. | |
| /** | |
| * Generate a cryptographically secure random password in the browser. | |
| * | |
| * This is a modified version of https://stackoverflow.com/a/43020177/450127 that aims to | |
| * to improve readability, and increase the length and character pool. The results should be | |
| * the same as the original. |
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
| # Alias to convert a stereo recording to mono | |
| # | |
| # $1 - The input filename | |
| function qtmono { | |
| basename=$(basename "$1") | |
| filename="${basename%.*}" | |
| extension="${basename##*.}" | |
| ffmpeg -i $1 -codec:v copy -af pan="mono: c0=FL" $filename-mono.$extension | |
| } |
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 | |
| // type "error" into the city name field to simulate an HTTP request error | |
| function nearbywp_trigger_error( $request, $request_args, $request_url ) { | |
| $url_params = explode( '&', parse_url( $request_url, PHP_URL_QUERY ) ); | |
| if ( in_array( 'location=error', $url_params ) ) { | |
| $request = new WP_Error( 'test', 'testing error condition' ); | |
| } |
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
| moved to https://core.trac.wordpress.org/ticket/40702 |
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 Remove Red Notification Dot From Trello Favicon | |
| // @namespace https://iandunn.name | |
| // @version 0.1 | |
| // @description Trello adds a red dot to their favicon when new notifications are available, which I find useless and distracting. This restores the original icon after a few seconds, so that you normally see the favicon without the dot. | |
| // @author Ian Dunn | |
| // @match https://trello.com/* | |
| // @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
| /** | |
| * Configure PHPMailer to send via PHP's mail() | |
| * | |
| * @param PHPMailer $phpmailer | |
| */ | |
| function phpmailer_send_via_mail( $phpmailer ) { | |
| $phpmailer->IsMail(); | |
| } | |
| add_action( 'phpmailer_init', 'phpmailer_send_via_mail', 999 ); |
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
| vagrant @ vvv in /srv/www/wordpress-meta-environment/wordpressorg.dev/public_html/wp-content/plugins | |
| > git clone [email protected]:WordPress/phpdoc-parser.git | |
| Cloning into 'phpdoc-parser'... | |
| Warning: Permanently added the RSA host key for IP address '192.30.253.112' to the list of known hosts. | |
| remote: Counting objects: 1860, done. | |
| remote: Total 1860 (delta 0), reused 0 (delta 0), pack-reused 1860 | |
| Receiving objects: 100% (1860/1860), 1.00 MiB | 169.00 KiB/s, done. | |
| Resolving deltas: 100% (994/994), done. | |
| Checking connectivity... done. |
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
| # Avoid having to enter a password when you just want to `svn up` | |
| function svn() { | |
| local args=($@) | |
| local rest=(${args[@]:1:${#args[@]}}) | |
| local SVN="/usr/bin/svn" | |
| case $1 in | |
| up) | |
| source /root/config/environment-variables | |
| /bin/bash -c "$SVN --no-auth-cache --username $SVNUSER --password $SVNPASS up $rest" |
NewerOlder