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 | |
// Disable layouts. | |
$this->_helper->layout->disableLayout(); | |
// Disable view. | |
$this->_helper->viewRenderer->setNoRender(true); |
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 | |
if ($argc < 2) { | |
echo 'Usage: json2csv.php [input.json] output.csv', PHP_EOL; | |
exit(1); | |
} | |
$input = fopen($argc === 3 ? $argv[1] : 'php://stdin', 'r'); |
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
UPDATE | |
wp_options | |
SET | |
option_value = REPLACE(option_value, 'oldhost/somedirectory', 'newhost') | |
WHERE | |
option_value LIKE '%oldhost/somedirectory%'; |
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 SimplePaginator | |
{ | |
protected $pageCount; | |
protected $pageRangeLength = 5; | |
public function __construct($pageCount, $pageRangeLength) | |
{ |
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 | |
\DB::enableQueryLog(); | |
$foo = Foo::find(1); | |
dd(\DB::getQueryLog()); |
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 mb_ucfirst($value) | |
{ | |
return mb_strtoupper(mb_substr($value, 0, 1)) . mb_substr($value, 1); | |
} |
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
# Installs extra packages | |
sudo apt-get update | |
sudo apt-get -y install build-essential tcl8.5 | |
# Installs Redis | |
# http://redis.io/topics/quickstart | |
# https://www.digitalocean.com/community/tutorials/how-to-install-and-use-redis | |
# https://realguess.net/2014/07/19/non-interactive-redis-install/ | |
PORT=6379 | |
CONFIG_FILE=/etc/redis/6379.conf |
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 | |
// Assumes that the lower and upper bounds are exclusive | |
$scenarios = [ | |
// [AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA] | |
// [BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB] | |
['14:00', '15:00', '14:00', '15:00', true], |
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
<div class="hidden-sm-up">XS</div> | |
<div class="hidden-md-up hidden-xs-down">SM</div> | |
<div class="hidden-lg-up hidden-sm-down">MD</div> | |
<div class="hidden-xl-up hidden-md-down">LG</div> | |
<div class="hidden-lg-down">XL</div> |
OlderNewer