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
/usr/local/psa/admin/sbin/mailqueuemng -D |
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 | |
// Wordfence Cache Workaround | |
// Apache 2.4.? - 2.4.8 contains a bug between mod_dir and mod_rewrite that prevents Wordfence's Falcon | |
// caching from working on the homepage, but just the homepage. This is a workaround for that issue. | |
$targetDomain = 'www.yourdomain.com'; | |
// We'll need to check cookie existence to determine if the visitor is logged in. Some WP cookie names | |
// include a unique hash at the end, so we'll need to check by collecting all the cookie names, and | |
// passing them through a regex. |
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 | |
add_filter('nav_menu_css_class', function($classes, $item) { | |
switch (get_query_var('post_type')) { | |
case 'custom_post_type_name': | |
if ($item->object_id == THE_ID_FOR_THE_NAV_ITEMS_TARGET_PAGE) { | |
$classes = array_diff($classes, array('current_page_parent')); | |
} | |
break; | |
} |
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
VBoxManage modifyvm "VM name" --natdnshostresolver1 on |
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
escapeHTML = (function() { | |
var entities = { | |
'&': '&', | |
'<': '<', | |
'>': '>', | |
'"': '"', | |
"'": ''', | |
'/': '/' | |
}; |
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 Kfriend\Data; | |
use Closure; | |
class Proxy extends \ArrayObject | |
{ | |
public function __invoke($item, $default = null) | |
{ |
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 | |
ini_set('memory_limit', '400M'); | |
$doc = new DOMDocument(); | |
$doc->loadXML(file_get_contents('/path/to/xml/file.xml')); | |
$xpath = new DOMXpath($doc); | |
$nodes = $xpath->query('//*'); |
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
# Annoying Files | |
.AppleDouble | |
.DS_Store | |
.DS_Store? | |
._* | |
.Spotlight-V100 | |
.Trashes | |
Icon^M^M | |
Thumbs.db | |
ehthumbs.db |
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 | |
class Db | |
{ | |
protected $connection; | |
public function __construct(PDO $connection) | |
{ | |
$this->connection = $connection; |
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 | |
// Todo | |
// - Add arrary-like iterating capabilities | |
class Repository | |
{ | |
protected $attributes = array(); | |
public function __construct(array $attributes = array()) |