Skip to content

Instantly share code, notes, and snippets.

View tcelestino's full-sized avatar
⛱️
Working from home

Tiago Celestino tcelestino

⛱️
Working from home
View GitHub Profile
@tcelestino
tcelestino / gmail-snippet.txt
Created March 5, 2014 13:31
gmail snippets
l:^g – Para encontrar conversas que foram interrompidas.
l:^p – Mensagens marcadas como phishing.
l:^op – As marcadas como phishing de forma automática pelo Gmail
l:^os – As marcadas de forma automática como spam
l:^vm – As mensagens de voz de Google Voice voicemail
l:^io_im – As mensagens importantes
l:^unsub – As que incluem opção para cancelar assinatura
l:^cff – Os e-mails de nossos contatos do Google+
l:^p_esnotif – As notificações de Google+
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@tcelestino
tcelestino / jquery.browser.js
Created April 7, 2014 21:17
jquery browser
(function( jQuery ) {
var matched,
userAgent = navigator.userAgent || "";
// Use of jQuery.browser is frowned upon.
// More details: http://api.jquery.com/jQuery.browser
// jQuery.uaMatch maintained for back-compat
jQuery.uaMatch = function( ua ) {
ua = ua.toLowerCase();
function valida(selector, show_errors) {
var show_errors = (show_errors!=undefined)?show_errors:true;
var validaForm = true;
/*var $input = $("input[type=email]").val();
var _reg = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
if(!_reg.test($input)) {
alert("digite um email válido");
@tcelestino
tcelestino / truncate.js
Created October 15, 2014 17:22
truncate string
/**
* truncate title
* @param {String} text suffix
* @param {Number} size text
* @return {String} text truncate
*/
var truncateText = function(str, size, suffix) {
var newTitle;
@tcelestino
tcelestino / .jscsrc
Created October 29, 2014 16:24
config jscs to sublime linter
{
"requireCurlyBraces": true,
"requireSpaceAfterKeywords": true,
"requireSpaceBeforeBlockStatements": true,
"requireParenthesesAroundIIFE": true,
"requireSpacesInConditionalExpression": true,
"requireSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
{
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : true, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
@tcelestino
tcelestino / mysql-pass.txt
Created November 12, 2014 00:45
set password mysql mac os
cd /usr/local/mysql/bin/
./mysql -u root -p
> Enter password: [type old password invisibly]
use mysql;
update user set password=PASSWORD("NEW_PASSWORD_HERE") where User='root';
flush privileges;
quit
@tcelestino
tcelestino / breakpoint-media-queries.css
Created November 24, 2014 20:40
breakpoints media queries
/*
0480
*/
@media only screen and (min-width : 320px) and (max-width : 660px){}
/*
0780
*/
@media only screen and (min-width : 661px) and (max-width : 860px) {}
@tcelestino
tcelestino / gist:76f3b27e8606bcbc557d
Created February 10, 2015 01:10
convert .wav file to .mp3
ffmpeg -i song.wav song.mp3