Skip to content

Instantly share code, notes, and snippets.

Avatar

Miguel Montalvo montalvomiguelo

View GitHub Profile
View .gvimrc.local
set guifont=Monaco:h16
set transparency=0
View .gvimrc.local
set guifont=Monaco:h16
set transparency=0
View gist:a1db2aea99f4db4892a2

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
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 Pure 0.4.2 Visibility Classes
@media (min-width: 980px) {
.pure-visible-phone {
display: none;
}
.pure-visible-tablet {
display: none;
}
.pure-hidden-desktop {
display: none;
}
@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 scramble.js
var brand = document.getElementById('brand');
var intervals = [];
function scramble(element, text, time) {
var length = element.innerText.length;
var diff = (length - text.length) * -1;
var count = 0;
var lettersPerIteration = 0;
if (diff !== 0) {
View shopify_common.js
/*
* Shopify Common JS
*
*/
// set a given selector with value, if value is one of the options
Shopify.setSelectorByValue = function(selector, value) {
for (let i = 0, count = selector.options.length; i < count; i++) {
const option = selector.options[i];
if (value == option.value || value == option.innerHTML) {