Skip to content

Instantly share code, notes, and snippets.

View Tagliatti's full-sized avatar

Filipe Tagliatti Tagliatti

View GitHub Profile
@Tagliatti
Tagliatti / .bash_aliases
Last active December 2, 2019 18:33
.bash_aliases
# git
alias g="git"
alias gs="git status"
alias gacp="git add. && git commit -m '.' && git push origin $(git branch | grep \* | cut -d ' ' -f2)"
alias gp="git push origin $(git branch | grep \* | cut -d ' ' -f2)"
alias ga="git add ."
alias gac="git add . && git commit -m"
alias gc="git commit -m"
alias gca="git commit --amend"
alias gcan="git commit --amend --no-edit"
@Tagliatti
Tagliatti / object to formdata
Created November 10, 2017 19:36
object to formdata
function toFormData(obj, form, namespace) {
let fd = form || new FormData();
let formKey;
for(let property in obj) {
if(obj.hasOwnProperty(property) && obj[property]) {
if (namespace) {
formKey = namespace + '[' + property + ']';
} else {
formKey = property;
@Tagliatti
Tagliatti / composer.bat
Created October 1, 2016 03:27 — forked from JCook21/composer.bat
Quick Batch file to add a 'composer' command to windows.
@echo off
if "%PHPBIN%" == "" set PHPBIN=C:\path\to\PHP\executable\dir\.\php.exe
"%PHPBIN%" "C:\path\to\composer.phar" %*
@Tagliatti
Tagliatti / mario.html
Created November 23, 2015 18:38
Mario
\\\\\\\\\\\\\\\
\\\\\\\\\\\\\\\
\\\\\\\\\\\\\\\\\\\\\\\\\\\
\\\\\\\\\\\\\\\\\\\\\\\\\\\
#########++++++###+++
#########++++++###+++
###+++###+++++++++###++++++
###+++###+++++++++###++++++
###+++######+++++++++###+++++++++
###+++######+++++++++###+++++++++
@Tagliatti
Tagliatti / number.format
Created December 19, 2014 03:00
Number Format
function formatNumber(number)
{
number = parseFloat(number);
var number = number.toFixed(2) + '';
var x = number.split('.');
var decimal = x[0];
var value = x.length > 1 ? ',' + x[1] : '';
var pattern = /(\d+)(\d{3})/;
@Tagliatti
Tagliatti / Redirecionar domínio sem www para www
Created October 4, 2014 02:31
Redirecionar domínio sem www para www
RewriteCond %{HTTP_HOST} ^dominio.com [NC]
RewriteRule (.*) http://www.dominio.com/$1 [L,R=301]
@Tagliatti
Tagliatti / validaPIS.Pasep.js
Last active April 25, 2023 18:14
Valida PIS/Pasep - JS
function validarPIS(pis) {
var multiplicadorBase = "3298765432";
var total = 0;
var resto = 0;
var multiplicando = 0;
var multiplicador = 0;
var digito = 99;
// Retira a mascara
var numeroPIS = pis.replace(/[^\d]+/g, '');