Skip to content

Instantly share code, notes, and snippets.

Avatar

Miguel Montalvo montalvomiguelo

View GitHub Profile
@montalvomiguelo
montalvomiguelo / dbconversion.php
Created Jun 19, 2016 — forked from blbwd/dbconversion.php
Convert MySQL collation from utf8mb4 to utf8
View dbconversion.php
<?php
$dbname = 'your-database-name';
mysql_connect('your-database-hostname', 'your-database-username', 'your-database-password');
mysql_query("ALTER DATABASE `$dbname` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci");
$result = mysql_query("SHOW TABLES FROM `$dbname`");
while($row = mysql_fetch_row($result)) {
$query = "ALTER TABLE {$dbname}.`{$row[0]}` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci";
mysql_query($query);
$query = "ALTER TABLE {$dbname}.`{$row[0]}` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci";
mysql_query($query);
View .vimrc
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
View gist:a1db2aea99f4db4892a2

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
View .gvimrc.local
set guifont=Monaco:h16
set transparency=0
View .gvimrc.local
set guifont=Monaco:h16
set transparency=0