Skip to content

Instantly share code, notes, and snippets.

@sillero
sillero / dabblet.css
Created April 27, 2012 18:57
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body {
background: #fff;
min-height: 100%;}
div {
float: left
}
@sillero
sillero / Teste.teste
Created July 5, 2012 00:14
Teste nome
Teste de texto
E duas linhas
@sillero
sillero / Teste.md
Created July 5, 2012 01:00
Teste md

#heading Text

@sillero
sillero / placeholder-polyfill.js
Created August 21, 2012 17:02
Placeholder polyfill (jQuery)
function placeholderPolyfill(el, opt){
opt = opt || {};
var $el = $(el),
testAttribute = function(element, attribute) {
var test = document.createElement(element);
return (attribute in test);
};
if (!testAttribute('input','placeholder') && $el.attr('placeholder').length) {
var defaults = {
clearOnSubmit: true
@sillero
sillero / github.css
Created September 17, 2012 17:28 — forked from tuzz/github.css
Github Markdown Stylesheet
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px;
color: #333;
}
@sillero
sillero / toFixed.js
Created October 22, 2012 19:35
javascript - avoiding bugs in .toFixed()
function toFixed(num, dec) {
var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec),
$arr = (result+[]).split('.'),
$int = $arr[0] + '.',
$dec = $arr[1] || '0';
return $int + $dec + (Math.pow(10,(dec - $dec.length))+[]).substr(1);
}
//OR
@sillero
sillero / readme.md
Created October 23, 2012 18:08
LiveReload + Sublime Text 2

#Como funciona? A extensão/addon se conecta ao Sublime e quando qualquer arquivo é salvo lá (independente da localização) o browser faz um refresh.

#Pré-requisitos 0. Sublime Text 2 0. Sublime Package Control

#Instalação 0. Através do Package Control (windows: ctrl+shift+p -> Package Control: Install Package) 0. Reiniciar o Sublime

@sillero
sillero / jquery.nstpubsub.js
Last active October 12, 2015 05:08
jQuery not-so-tiny Pub/Sub
/* jQuery Not-So-Tiny Pub/Sub - v0.4 - 2013-01-15
* http://sillero.github.com/
* Copyright (c) 2012 "sillero" Gustavo Sillero; Licensed MIT, GPL
*
* UPDATE (2013-01-15): now e (event) gets the folowwing properties
* published (eventName used in $.publish)
* subscribed (eventName used in $.subscribe)
*
* usage:
* $.subscribe('/path1', function(e, response){ console.log('path1',response.data); })
@sillero
sillero / Main.sublime-menu
Created November 1, 2012 18:11 — forked from GCheung55/Main.sublime-menu
Sublime Text 2 Layouts
/**
* Sublime Text 2 Layouts
* Place file in or modify file if existing
*
* OSX: /Users/ [USERNAME] /Library/Application Support/Sublime Text 2/Packages/User/
* Windows: C:\Users\ [USERNAME] \…\Sublime Text 2\Packages\User
*
*/
[{
@sillero
sillero / gist:4032637
Created November 7, 2012 16:30
Sublimelinter - remove 'missing radix' warning for parseInt

comment out these lines in jshint.js and jslint.js

if (left.value === "parseInt" && n === 1) {
    warning("Missing radix parameter.", token);
}

that's it :)