Skip to content

Instantly share code, notes, and snippets.

View git create branch from remote
git checkout -b nomDeMaBrancheDistante origin/nomDeMaBrancheDistante
fatal: git checkout: updating paths is incompatible with switching branches/forcing
Did you intend to checkout ‘origin/‘ which can not be resolved as commit?’
git remote update
mikedamoiseau / cakephp-last-executed-query
Created Jul 9, 2014
CakePHP - Display last executed SQL query
View cakephp-last-executed-query
$dbo = $this->Job->getDatasource();
$logs = $dbo->getLog();
$lastLog = end($logs['log']);
debug( $lastLog['query'] );
UP=$(pgrep mysql | wc -l);
if [ "$UP" -ne 1 ];
echo "MySQL is down.";
sudo service mysql start
echo "All is well.";
mikedamoiseau /
Last active Aug 29, 2015
Mysql database import/export with command line
# Export the database to a file
mysqldump -u YourUser -p 'UserPassword' YourDatabaseName | gzip > wantedsqlfile.sql.gz
# Make a local copy the file from the server
scp your_detination_path/
# Import the database locally
gunzip filename.sql.gz | mysql -u [user] -p [password] [database]
View PHP Countries Array
$countries = array("Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Island
mikedamoiseau / wordpress-plugins
Last active Dec 31, 2015
Plugins for a good and secure Wordpress website
View wordpress-plugins
## Security
All In One WP Security
Wordpress Login Delay
## SEO
Google XML Sitemaps
SEO Friendly Images
All In One SEO Pack OR Yoast
Far Future Expiration Plugin (this one cannot be installed from the search plugin functionality:

Things to do after install Ubuntu

  • Update all packages
  • Install Unity2D
  • Install Vim sudo apt-get install vim
  • Change default editor to be Vim editor-select
  • Install Google Chrome
  • Customize terminal prompt .bashrc and .vimrc
  • Install LAMP sudo apt-get install tasksel
  • Install PHPMyAdmin sudo apt-get install phpmyadmin