Skip to content

Instantly share code, notes, and snippets.

View tarciozemel's full-sized avatar

Tárcio Zemel tarciozemel

View GitHub Profile
@tarciozemel
tarciozemel / git-temporary-ignore.md
Last active May 24, 2022 13:29 — forked from sloanlance/git-temporary-ignore.md
git: Ignorar temporariamente arquivos novos ou alterados sem alterar .gitignore

There are times notifications aren't wanted about either a changed repo file or a new file that needs to be added to the repo. However, adding the name of the file to .gitignore might not be a good option, either. For example, locally-generated files that other users aren't likely to generate (e.g., files created by an editor) or files of experimental test code might not be appropriate to appear in a .gitignore file.

In those cases, use one of these solutions:

  1. If the file is a changed repo file

    Use the command:

    git update-index --assume-unchanged "$FILE"

@tarciozemel
tarciozemel / slugify.js
Created January 22, 2018 17:17 — forked from eek/slugify.js
Vanilla JavaScript Slugify + Accent removal - Just another JavaScript Slugifier with an extra line for Accent Removal
function slugify(text) {
return text.toString().toLowerCase().trim()
.normalize('NFD') // separate accent from letter
.replace(/[\u0300-\u036f]/g, '') // remove all separated accents
.replace(/\s+/g, '-') // replace spaces with -
.replace(/&/g, '-and-') // replace & with 'and'
.replace(/[^\w\-]+/g, '') // remove all non-word chars
.replace(/\-\-+/g, '-') // replace multiple '-' with single '-'
}
@tarciozemel
tarciozemel / gist:1884583
Last active June 22, 2016 16:52 — forked from adrienjoly/include.js
JavaScript: incluir arquivos js/css dinamicamente
/*
* Ex:
* include("http://mysite.com/bookmarklet.css");
* include("http://mysite.com/bookmarklet.js");
*/
let include = ( src, callback ) => {
let ext = src.split( /[\#\?]/ )[ 0 ].split( '.' ).pop().toLowerCase();
let inc;
if ( ext === 'css' ) {