Here's some helpful git examples and reference for everyday issues.
# set new remote url
git remote set-url origin <remote_git_url>
# Update the latest commit
git commit --amend
<?php | |
! defined('DB_HOST') && define('DB_HOST', '127.0.0.1'); | |
['false', '', false, true, '0', 0, null, NaN, 1, '1'].filter(Boolean); | |
// => ["false", true, "0", 1, "1"] | |
// 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; | |
<?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); | |
# 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> |
# Files | |
find . -type f | wc -l | |
# Directories | |
find . -type d | wc -l | |
# Block special | |
find . -type b | wc -l | |
# Character special |
/** | |
* 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) { |
find . -delete |
-- 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; |