あまり深く理解してないので識者のツッコミ大歓迎
取り敢えず最低限だけ
# 補完を有効にする| #!/bin/sh | |
| # check for where the latest version of IDEA is installed | |
| IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1` | |
| wd=`pwd` | |
| # were we given a directory? | |
| if [ -d "$1" ]; then | |
| # echo "checking for things in the working dir given" | |
| wd=`ls -1d "$1" | head -n1` |
| #!/usr/bin/env bash | |
| set -o errexit | |
| set -o nounset | |
| set -o pipefail | |
| # Automatically update your CloudFlare DNS record to the IP, Dynamic DNS | |
| # Can retrieve cloudflare Domain id and list zone's, because, lazy | |
| # Place at: | |
| # /usr/local/bin/cf-ddns.sh |
| <?php | |
| /** | |
| * Get a list of post types that support a specific feature. | |
| * | |
| * @param $feature | |
| * @return array | |
| */ | |
| function get_post_types_supporting( $feature ) { | |
| global $_wp_post_type_features; |
| <?php | |
| /** | |
| * Template Name: Archive Page */ | |
| ?> | |
| <?php | |
| $paged = (int) get_query_var('paged'); | |
| $args = array( | |
| 'posts_per_page' => 3, | |
| 'paged' => $paged, |
| function get_post_by_slug($post_name) { | |
| global $wpdb; | |
| $post = $wpdb->get_var($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_name = %s", $post_name)); | |
| return $post ? get_post($post) : NULL; | |
| } |
| <?php | |
| $client = ...; | |
| $response = $client->get('http://guzzlephp.org/index.html', null, tmpfile())->send(); | |
| $response->getStream(); // Magic comes after |
##Given Apache 2 and MySQL are already installed.
#Update MacPorts sudo port selfupdate;sudo port -u upgrade outdated
#Install PHP 5.4.* sudo port install php54 php54-apache2handler ##Activate Apache Module cd /opt/local/apache2/modules
| // 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 | |
| */ |