Skip to content

Instantly share code, notes, and snippets.

View thomascrepain's full-sized avatar
🎯
Focusing

Thomas Crepain thomascrepain

🎯
Focusing
View GitHub Profile
@thomascrepain
thomascrepain / MySQL Cheat sheet
Last active December 29, 2015 17:39
MySQL Cheat sheet - much used but not remembered
# create user
CREATE USER 'myuser'@'%' IDENTIFIED BY 'password';
# grant user all rights on database
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' WITH GRANT OPTION;
# create database with UTF8 character set
create database databasename DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
# To dump a Mysql database and gzip it:
@thomascrepain
thomascrepain / Global Debug Function
Created November 29, 2013 12:41
Debug function to be temporally added in global namespace to quickly have a var_dump everywhere in the application
function debug($msg, $exit=true) {
if($_SERVER['REMOTE_ADDR'] == '192.168.0.0') { // only for my ip
echo "<pre>";
var_dump($msg);
echo "</pre>";
if ($exit) {
exit;
}
}