This file contains 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
DELETE a,b,c | |
FROM wp_posts a | |
LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) | |
LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) | |
WHERE a.post_type = 'revision' |
This file contains 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
D:\webserver>mklink /d d:\webserver\apache\ d:\webserver\apache22 |
This file contains 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
$request->getScheme().'://'.$request->getHttpHost().$request->getBasePath().$request->getPathInfo(); |
This file contains 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
shutdown -s -f -t 60 |
This file contains 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
$request->query->get('term'); |
This file contains 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 ResumeDownload { | |
private $file; | |
private $name; | |
private $boundary; | |
private $delay = 0; | |
private $size = 0; | |
function __construct($file, $delay = 0) { | |
if (! is_file($file)) { |
This file contains 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 Foo { | |
protected $var1; | |
protected $var2; | |
/* Get Properties | |
* | |
* Get all class properties at once and put it in an array | |
* | |
* @return array $class_vars |
This file contains 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 | |
function generateRandomString($length = 12) { | |
$characters = '23456789abcdefghijkmnpqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ !@#$%^&*()_-'; | |
$randomString = ''; | |
for ($i = 0; $i < $length; $i++) { | |
$randomString .= $characters[rand(0, strlen($characters) - 1)]; | |
} | |
return $randomString; | |
} |
This file contains 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
using (ZipFile zip = ZipFile.Read(@"D:\path\to\ZipFile.zip")) | |
{ | |
zip.RemoveSelectedEntries("foldername/*"); // Remove folder and all its contents | |
zip.Save(); | |
} |
This file contains 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
wp-config.php: | |
define('AUTOSAVE_INTERVAL', 300 ); // seconds | |
define('WP_POST_REVISIONS', false ); | |
SQL: | |
DELETE FROM wp_posts WHERE post_type = "revision"; |