Skip to content

Instantly share code, notes, and snippets.

View luis-fss's full-sized avatar
:octocat:
Hey

Luis Fernando de Souza Santos luis-fss

:octocat:
Hey
View GitHub Profile
@victor-rds
victor-rds / brdocs.cpfcnpjValidator.js
Last active July 11, 2024 19:13
Extensão para JQuery Validation Plugin (jqueryvalidation.org) que valida o número de CPF ou CNPJ (inclusive os dois ao mesmo tempo num único campo), usa "namespace" brdocs para evitar conflitos, a função calculaDigito() pode ser usada sozinha caso você deseje mudar a lógica do validador ou criar seu método de validação em outro framework ou plugin.
brdocs = {
/**
* Enum com opções do validador
* @readonly
* @enum {number}
*/
cpfcnpj: { "CPF": 1, "CNPJ": 2, "AMBOS": 3 },
/**
* Função que valida CPF e CNPJ de uma só vez.
@rponte
rponte / get-latest-tag-on-git.sh
Last active December 9, 2024 00:27
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
@luis-fss
luis-fss / NugetCommandLineTips.txt
Created November 18, 2015 23:49
Nuget command line tips
Nuget command line – uninstall package from all projects
> Get-Project -All | Uninstall-Package <package name>
@patriksvensson
patriksvensson / powershell.cake
Created March 8, 2016 09:20
Run PowerShell scripts from Cake
// Tools and addins
#addin "nuget:?package=System.Management.Automation&version=6.1.7601.17515"
using System.Collections;
using System.Management.Automation;
using System.Management.Automation.Internal;
using System.Management.Automation.Runspaces;
using System.Threading;
///////////////////////////////////////////////////////////////////////////////
@bendc
bendc / supportsES6.js
Created August 25, 2016 08:05
Test if ES6 is ~fully supported
var supportsES6 = function() {
try {
new Function("(a = 0) => a");
return true;
}
catch (err) {
return false;
}
}();
function Update-AssemblyInfoVersionFiles
{
Param
(
[Parameter(Mandatory=$true)]
[string]$productVersion
)
$buildNumber = $env:BUILD_BUILDNUMBER
if ($buildNumber -eq $null)
@pedrofracassi
pedrofracassi / quicksteamactivator.user.js
Last active November 25, 2023 17:06
Steam Key Quick Activator
// ==UserScript==
// @name Steam Key Quick Activator
// @namespace http://pedrofracassi.me/
// @version 1.2
// @description Activates Steam Keys Quickly!
// @author Pedro Fracassi (http://pedrofracassi.me)
// @match https://store.steampowered.com/account/registerkey?key=*
// @grant none
// @run-at document-end
// ==/UserScript==
@jioo
jioo / share-git-stash.md
Last active December 31, 2024 08:35
How to export stash as a file, and apply it to another computer

Stash current changes

  • git > Stash > Stash (Include Untracked)

Create stash as patch

git stash show "stash@{0}" -p > changes.patch

Apply patch

@luis-fss
luis-fss / gulpfile.js
Created April 28, 2020 14:03
NPM and Gulp for Asp.Net Core 3 config sample
/// <binding AfterBuild='default' Clean='clean' />
/*
This file is the main entry point for defining Gulp tasks and using Gulp plugins.
Click here to learn more. http://go.microsoft.com/fwlink/?LinkId=518007
*/
var gulp = require('gulp');
var del = require('del');
var plumber = require('gulp-plumber');
var concat = require('gulp-concat');
@luizfelipeleite
luizfelipeleite / scripts.js
Last active May 29, 2024 13:50
Máscaras CPF, CNPJ, CEP e Telefone no Cleave
String.prototype.numbers = function () {
'use strict';
var result = '';
if (this.match(/(\d+)/g)) {
result = this.match(/(\d+)/g).join('');
}
return result;
};
( function( $ ) {