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 *:8080> | |
ServerName PROJECT_NAME.dev | |
ServerAlias www.PROJECT_NAME.dev | |
DocumentRoot PROJECT_DIR | |
<Directory "PROJECT_DIR"> | |
Options Indexes FollowSymLinks | |
AllowOverride All | |
Require all granted | |
</Directory> | |
</VirtualHost> |
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 old docker containers | |
sudo docker rm `sudo docker ps --no-trunc -a -q` | |
# Delete old docker images | |
sudo docker rmi $(sudo docker images -a | grep -P '([A-z0-9_\-<>\/]+)\s+([A-z0-9_\-<>\/]+)\s+([A-z0-9_\-<>\/]+).*$' | awk '{print $3}') |
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
git config alias.migrate-to '!f() { make checkout BRANCH=$1; }; f' |
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
SELECT table_name, index_name, GROUP_CONCAT(column_name) | |
FROM information_schema.statistics | |
WHERE table_schema = 'my_db' | |
AND non_unique = 1 | |
GROUP BY table_name, index_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
SELECT table_name, index_name, GROUP_CONCAT(DISTINCT column_name), index_type | |
FROM information_schema.statistics | |
WHERE table_name = 'categories' | |
AND non_unique = 1 | |
GROUP BY table_name, index_name, index_type |
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
// applied to elements with class of "dont-break" | |
$('.dont-break').wrap('<table style="page-break-inside: avoid; width: 100%;" />'); |
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
(function batman(){ | |
return Array(16).join({}-1)+" "+arguments.callee.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
{ | |
// The tab key will cycle through the settings when first created | |
// Visit http://wbond.net/sublime_packages/sftp/settings for help | |
// sftp, ftp or ftps | |
"type": "ftps", | |
"save_before_upload": true, | |
"upload_on_save": true, | |
"sync_down_on_open": 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 | |
/** | |
* Invert a multidimensional array | |
* @param array $origArray | |
* @return array | |
*/ | |
function invertMultidimensionalArray($origArray) { | |
$invertedArray = array(); | |
foreach ($origArray as $i => $sub) { | |
foreach ($sub as $key => $val) { |
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 | |
/** | |
* Dump the given value to stdout | |
* | |
* @param mixed $value | |
* @return void | |
*/ | |
function dout($value) | |
{ |
OlderNewer