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
if hash jq 2>/dev/null; then | |
brew install jq | |
fi | |
for module in $(jq '.dependencies | keys' bower.json | strings); do | |
bower install --save $(echo $module | tr -d '",') | |
done |
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
0,30 * * * * wget -qO- --delete-after https://yourdomain.com/wp-cron.php?doing_wp_cron |
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
# Backup a directory | |
cd ~ | |
tar cvfz public_html.tar.gz public_html/ | |
# Restore a directory | |
cd ~/public_html/ | |
tar xvfz ../public_html.tar.gz |
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
# Preparing custom image for running build commands. | |
# /usr/local/rvm/scripts/override_gem: line 19: gem: command not found | |
# ... | |
# events.js:85 | |
# output throw er; // Unhandled 'error' event | |
# output ^ | |
# output Error: Gem sass is not installed. | |
## | |
# To fix, add the following code to the start of your container setup scripts |
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
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME}\.php -f | |
RewriteRule ^(.*)$ $1.php |
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
CREATE USER 'dev'@'localhost' IDENTIFIED BY 'dev'; | |
GRANT ALL PRIVILEGES ON *.* TO 'dev'@'localhost'; | |
CREATE USER 'dev'@'%' IDENTIFIED BY 'dev'; | |
GRANT ALL PRIVILEGES ON *.* TO 'dev'@'%'; | |
FLUSH PRIVILEGES; |
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 | |
session_start(); | |
if (!array_key_exists('items', $_SESSION) || [] === $_SESSION['items']) { | |
$_SESSION['items'] = [ | |
'Go to the park', | |
'Draw something', | |
'Go to the zoo', | |
'Play a musical instrument', |
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 | |
$phar = new Phar('project.phar', 0, 'project.phar'); | |
$phar->buildFromDirectory(dirname(__FILE__) . '/phar'); | |
$phar->setStub($phar->createDefaultStub('index.php')); | |
// To generate the .phar file, run the following commands from the current directory: | |
// mkdir -p phar | |
// cp -R ./*.php phar/. | |
// cd phar && php ../build-phar.php |
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 | |
print('foo') && print(' ') && print('bar'); // bar11 | |
print('foo') || print(' ') && print('bar'); // 1 | |
print('foo') && print(' ') || print('bar'); // 11 | |
print('foo') || print(' ') || print('bar'); // 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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_URI} !^/public | |
RewriteRule ^(.*)$ public/$1 [L] | |
</IfModule> |