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 | |
# | |
# verify deployment targets | |
# | |
declare -A targets | |
targets=( | |
["blog.examplehost.com"]='/var/www/path/to/webroot/' | |
) |
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
-- This will be for ALL hosts, not just localhost, if you want it to only be for | |
-- localhost, then change 'codfish'@'%' to 'codfish'@'localhost' | |
CREATE USER 'codfish'@'%' IDENTIFIED BY 'password_here'; | |
GRANT ALL PRIVILEGES ON `database_name`.* TO 'codfish'@'%'; | |
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
find . -delete |
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
/** | |
* jQuery animated scroll to | |
* | |
* @example | |
* <a class="animated-scroll" data-target=".elem-selector-scroll-to" data-offset="60">Go to top</a> | |
* | |
* @param {data-target} the jquery selector of the dom element you want to scroll to | |
* @param {data-offset} how far from the top of the window you want the element to be (in pixels). Default is 20px. | |
*/ | |
$(document).on('click', '.animated-scroll', function(e) { |
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
# Files | |
find . -type f | wc -l | |
# Directories | |
find . -type d | wc -l | |
# Block special | |
find . -type b | wc -l | |
# Character special |
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
# display the current memcache process running in order to find the proper port number | |
ps auxw | grep memcache | |
# flush memcache. replace <port> with value from above | |
echo flush_all | nc localhost <port> |
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 | |
// @see http://xdebug.org/docs/all_settings | |
ini_set('xdebug.var_display_max_depth', -1); | |
ini_set('xdebug.var_display_max_children', -1); | |
ini_set('xdebug.var_display_max_data', -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
// It will always return an integer (never NaN) and will set v to 0 if it was not a number. | |
// Credit: http://qr.ae/ftLRB | |
v = ~~v; | |
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
['false', '', false, true, '0', 0, null, NaN, 1, '1'].filter(Boolean); | |
// => ["false", true, "0", 1, "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
<?php | |
! defined('DB_HOST') && define('DB_HOST', '127.0.0.1'); | |