🏋️♂️
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
#!/bin/bash | |
# Copy this file on /usr/loca/bin/xdebug and test your PHP configuration with "xdebug -i | grep -i xdebug" | |
XDEBUG_CONFIG="idekey=PHPSTORM" php \ | |
-dxdebug.remote_host=`echo $SSH_CLIENT | cut -d "=" -f 2 | awk '{print $1}'` \ | |
-dxdebug.remote_enable=On \ | |
-dxdebug.remote_connect_back=On \ | |
-dxdebug.remote_port=9000 \ | |
"$@" |
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 TABLEA a | |
JOIN TABLEB b ON a.join_colA = b.join_colB | |
SET a.columnToUpdate = [something] |
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 a branch | |
cd master/ | |
git branch branch_name | |
git checkout branch_name | |
git push origin branch_name | |
# Create and switch to a new branch | |
cd master/ | |
git checkout -b branch_name | |
git push origin branch_name |
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
zend_extension=xdebug.so | |
xdebug.default_enable = On | |
xdebug.profiler_enable = On | |
xdebug.profiler_output_dir = "/tmp/xdebug" | |
xdebug.profiler_append = On | |
xdebug.profiler_enable_trigger = On | |
xdebug.profiler_output_name = "%u_%p.profile.xlog" |
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
<VirtualHost *:443> | |
SSLEngine On | |
SSLCertificateFile /etc/apache2/ssl/www.example.com.crt | |
ServerName example.com | |
ServerAlias www.example.com | |
<Directory "/var/www/example/"> | |
AllowOverride All | |
Order allow,deny |
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
<LocationMatch ^/(folder1|folder2|folder3\/child)/(.*)[\/]{0,1}feed> | |
Order deny,allow | |
Deny from all | |
Allow from mydomain.com 80.80.80.10/15 | |
</LocationMatch> |
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
<VirtualHost *:443> | |
SSLEngine On | |
# sudo apt-get install ssl-cert | |
# sudo a2enmod ssl | |
# Generate the crt file with: sudo make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/www.example.com.crt | |
SSLCertificateFile /etc/apache2/ssl/www.example.com.crt | |
ServerName www.example.com |
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
# Example 1 | |
mysqldump --databases dbname -u root -p > dbname.sql | |
# Example 2 | |
mysqldump --databases dbname -u root -pPASSWORD | gzip -c > dbname.sql.gz | |
# Example 3 (just the schema with no data and disabling foreign keys) | |
mysqldump -u root -pPASSWORD --no-data --single-transaction --quick --lock-tables=false -y --disable-keys dbname | gzip -c > dbname_schema.sql.gz | |
# Example 4 (loading the DB back into MySQL) |
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 `t` FROM `category_translation` AS `t` | |
LEFT JOIN `category` AS `c` | |
ON `c`.`id` = `t`.`id` | |
WHERE `c`.`id` IS NULL; |
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
# /etc/apache2/sites-enabled/site | |
<VirtualHost *:80> | |
RewriteEngine On | |
RewriteOptions Inherit | |
ServerAdmin admin@example.com | |
ServerName example.com |