Skip to content

Instantly share code, notes, and snippets.

## git has a different solution to do this. First change the file you do not want to be tracked and use the following command:
git update-index --assume-unchanged FILE_NAME
## and if you want to track the changes again use this command:
git update-index --no-assume-unchanged FILE_NAME
## Drop (i.e. remove tables)
mysql -Nse 'show tables' DATABASE_NAME | while read table; do mysql -e "drop table $table" DATABASE_NAME; done;
## Truncate (i.e. empty tables)
mysql -Nse 'show tables' DATABASE_NAME | while read table; do mysql -e "truncate table $table" DATABASE_NAME; done;
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL|E_STRICT);
function getDocHeight(D) {
return Math.max(
Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
Math.max(D.body.clientHeight, D.documentElement.clientHeight)
);
}
function nl2br (str, is_xhtml) {
// * example 1: nl2br('Kevin\nvan\nZonneveld');
// * returns 1: 'Kevin<br />\nvan<br />\nZonneveld'
// * example 2: nl2br("\nOne\nTwo\n\nThree\n", false);
// * returns 2: '<br>\nOne<br>\nTwo<br>\n<br>\nThree<br>\n'
// * example 3: nl2br("\nOne\nTwo\n\nThree\n", true);
// * returns 3: '<br />\nOne<br />\nTwo<br />\n<br />\nThree<br />\n'
var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '<br />' : '<br>';
return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2');
## Deny All Access
Order deny,allow
Deny from all
## Here you can define an IP that is allowed access
## Allow from xxx.xxx.xxx.xxx
## --------------------------------------------------------------- ##
## Deny Access to Hidden Files and Directories
#center{
background: #CCC;
padding: 30px 100px;
position: absolute;
left: 50%;
top: 50%;
white-space: nowrap;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
SET FOREIGN_KEY_CHECKS=0;
SET FOREIGN_KEY_CHECKS=1;
grep -rl "matchstring" dir/* | xargs sed -i 's/string1/string2/g'
sudo fuser -k 9000/tcp