Skip to content

Instantly share code, notes, and snippets.

View tcelestino's full-sized avatar
🙃

Tiago Celestino tcelestino

🙃
View GitHub Profile
{
// 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 / .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
},
@tcelestino
tcelestino / .zshrc
Last active October 18, 2018 13:53
my settings to oh-my-zsh
# Path to your oh-my-zsh installation.
export ZSH=/Users/tcelestino/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="honukai"
# Uncomment the following line to use case-sensitive completion.
@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;
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 / 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();
@tcelestino
tcelestino / git-snippets.md
Last active July 26, 2019 17:56
git snippets

Git Snippets

BRANCH

git clone -b <branchName> <urlRepo> #faz o clone de um  branch especifico.
git branch -D <branchName> #deletar branch local
git push origin --delete <branchName> #atualiza repo com a remoção da branch
git branch -m <oldName> <newName> #renomeia uma branch
git push --set-upstream origin <branchName> #faz push da branch local para o repo
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@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+
@tcelestino
tcelestino / wp-mail-fork.php
Created January 9, 2014 09:13
WP-Mail plugin modify
<?php
/**
* Plugin Name: WP-EMail
* Plugin URI: http://lesterchan.net/portfolio/programming/php/
* Description: Allows people to recommand/send your WordPress blog's post/page to a friend.
* Version: 2.52
* Author: Lester 'GaMerZ' Chan
* Author URI: http://lesterchan.net
*/
/*