This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.
— Erik
| #!/bin/sh | |
| ## backup each mysql db into a different file, rather than one big file | |
| ## as with --all-databases. This will make restores easier. | |
| ## To backup a single database simply add the db name as a parameter (or multiple dbs) | |
| ## Putting the script in /var/backups/mysql seems sensible... on a debian machine that is | |
| ## Create the user and directories | |
| # mkdir -p /var/backups/mysql/databases | |
| # useradd --home-dir /var/backups/mysql --gid backup --no-create-home mysql-backup | |
| ## Remember to make the script executable, and unreadable by others |
| #!/bin/bash -e | |
| clear | |
| echo "============================================" | |
| echo "WordPress Install Script" | |
| echo "============================================" | |
| echo "Database Name: " | |
| read -e dbname | |
| echo "Database User: " | |
| read -e dbuser | |
| echo "Database Password: " |
| AddType text/cache-manifest manifest | |
| RewriteEngine On | |
| # Put your installation directory here: | |
| # If your URL is www.example.com/, use / | |
| # If your URL is www.example.com/site_folder/, use /site_folder/ | |
| RewriteBase / | |
| # Do not enable rewriting for files or directories that exist |
| // This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
| <?php | |
| /** | |
| * WordPress Query Comprehensive Reference | |
| * Compiled by luetkemj - luetkemj.github.io | |
| * | |
| * CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
| * Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
| */ |
| // Convert all Category input checkboxes in to radio selects | |
| // It completely replaces the elements with new ones and transfers | |
| // the attributes from the old element to the new. | |
| // We can't just change the type because of, you guessed it, Internet Explorer | |
| // Yes, sometimes a hand grenade is easier than a scalpel ;) | |
| jQuery('form#post').find('.categorychecklist input').each(function() { | |
| var new_input = jQuery('<input type="radio" />'), | |
| attrLen = this.attributes.length; | |
| for (i = 0; i < attrLen; i++) { |
| <?php | |
| /* | |
| Plugin Name: Rewrite Rule Tutorials | |
| */ | |
| add_action( 'init', 'pmg_rewrite_add_rewrites' ); | |
| function pmg_rewrite_add_rewrites() | |
| { | |
| add_rewrite_endpoint( 'json', EP_PERMALINK ); | |
| add_rewrite_rule( |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.