##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
#!/bin/bash | |
# Installation: | |
# 1. Save this script to /some/bin/ssh-background | |
# 2. chmod 755 /some/bin/ssh-background | |
# 3. alias ssh=/some/bin/ssh-background | |
# 4. Configure your host colors below. | |
set_color() { | |
local HEX_FG=$1 | |
local HEX_BG=$2 |
<?php | |
namespace Holy\Tests; | |
use Holy\Loader; | |
/** | |
* LoaderTest | |
* | |
* @author k.holy74@gmail.com | |
*/ |
<?php | |
if (!class_exists('WP_AddRewriteRules')): | |
class WP_AddRewriteRules{ | |
private $rule = null; | |
private $query = null; | |
private $callback = null; | |
function __construct($rule, $query, $callback) | |
{ |
<?php | |
if (!class_exists('WP_AddPage')): | |
class WP_AddPage { | |
private $rule = null; | |
private $title = null; | |
private $callback = null; | |
private $template = null; | |
private $filter = false; |
// 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 | |
*/ |
##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
<?php | |
$client = ...; | |
$response = $client->get('http://guzzlephp.org/index.html', null, tmpfile())->send(); | |
$response->getStream(); // Magic comes after |
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; | |
} |