Skip to content

Instantly share code, notes, and snippets.

@maese
maese / plain.js
Created March 29, 2016 13:00 — forked from kkga/plain.js
snippets of plain js
// document.ready
document.addEventListener("DOMContentLoaded", function() {
// your code
}, false);
// select div
var element = document.querySelector("div");
@maese
maese / Paginador
Last active August 29, 2015 14:20
/**
* Construye paginador
* Pad: pag. seleccionada + items alrededor de ella.
* En el caso de un número grande de páginas:
* y pag. seleccionada en posición central: aparece rodeada de puntitos.
* " izquierda: aparecen puntitos solo a la derecha
* " derecha: aparecen puntitos solo a la izquierda
* En el caso de un número pequeño de páginas:
* no aparecen puntitos
*
@maese
maese / setAllToMaxHeight
Last active October 8, 2015 23:08
Igualar altura divs (paul irish)
$.fn.setAllToMaxHeight = function(){
return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height() }) ) );
}
// usage: $(‘div.unevenheights’).setAllToMaxHeight()
@maese
maese / gist:3236016
Created August 2, 2012 09:57 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt