Help with SQL commands to interact with a MySQL database
- Mac /usr/local/mysql/bin
- Windows /Program Files/MySQL/MySQL version/bin
- Xampp /xampp/mysql/bin
| <?php | |
| /** | |
| * Class IceCastPlaylist | |
| * See https://stackoverflow.com/questions/60502076/how-to-get-icecast-server-songs-history/60798774#60798774 for context | |
| * | |
| * This class can be used as follows: | |
| * global $wpdb | |
| * $playlistClass = new IceCastPlaylist($wpdb); | |
| * $playlistClass->fetchSongInfo(); |
| <?php | |
| /** | |
| * by Adrian Statescu <[email protected]> | |
| * Twitter: @thinkphp | |
| * G+ : http://gplus.to/thinkphp | |
| * MIT Style License | |
| */ |
| <?php | |
| /** | |
| * When using the WordPress Importer, update existing | |
| * posts instead of skipping them. Updates content according | |
| * to the import file even if the existing post was updated | |
| * more recently. | |
| * | |
| * To use, drop this file into your /mu-plugins/ folder or | |
| * copy this code into your functions.php file. |
| <?php | |
| $taxonomy_objects = get_object_taxonomies( 'cpt', 'objects' ); // <--- change cpt with the custom post type | |
| $out = array(); | |
| foreach ( $taxonomy_objects as $taxonomy_slug => $taxonomy ){ | |
| $terms = get_terms( $taxonomy_slug, 'hide_empty=0' ); | |
| if ( !empty( $terms ) ) { | |
| $out[] = "<strong>" . $taxonomy->label . "</strong>\n<ul>"; | |
| foreach ( $terms as $term ) { | |
| $out[] = | |
| " <li>" |
| <?php | |
| /** | |
| * @link http://jonathonhill.net/2012-05-18/unshorten-urls-with-php-and-curl/ | |
| */ | |
| function unshorten_url($url) { | |
| $ch = curl_init($url); | |
| curl_setopt_array($ch, array( | |
| CURLOPT_FOLLOWLOCATION => TRUE, // the magic sauce | |
| CURLOPT_RETURNTRANSFER => TRUE, |
| .upload-thumb { | |
| display: inline-block; | |
| width: 120px; | |
| height: 120px; | |
| overflow: hidden; | |
| background: #e2e2e2; | |
| border: 1px solid #cdcdcd; | |
| line-height: 120px; | |
| margin-bottom: 10px; | |
| } |
| #!/bin/sh | |
| # | |
| # chmodr.sh | |
| # | |
| # author: Francis Byrne | |
| # date: 2011/02/12 | |
| # | |
| # Generic Script for recursively setting permissions for directories and files | |
| # to defined or default permissions using chmod. | |
| # |
| <IfModule mod_expires.c> | |
| ExpiresActive on | |
| # Perhaps better to whitelist expires rules? Perhaps. | |
| ExpiresDefault "access plus 1 month" | |
| # Data | |
| ExpiresByType text/xml "access plus 0 seconds" | |
| ExpiresByType application/xml "access plus 0 seconds" | |
| ExpiresByType application/json "access plus 0 seconds" |
| <?php | |
| /** | |
| * Skip cart and redirect to direct checkout | |
| * | |
| * @package WooCommerce | |
| * @version 1.0.0 | |
| * @author Alessandro Benoit | |
| */ | |
| // Skip the cart and redirect to check out url when clicking on Add to cart |