Skip to content

Instantly share code, notes, and snippets.

View marcelod's full-sized avatar
🎯
Focusing

Marcelo Diniz marcelod

🎯
Focusing
  • São Paulo - Brasil
View GitHub Profile
@ainsofs
ainsofs / gist:2b80771a5582b7528d9e
Created April 16, 2015 01:50
Clear .gitignore cache
# remove specific file from git cache
git rm --cached filename
# remove all files from git cache
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
@kelvinst
kelvinst / git-sweep.md
Last active February 22, 2022 01:02
Limpando os branches que você já fez merge

Limpando os branches que você já fez merge

Olá!

Bem, muitas vezes no dia-a-dia com o git, você abre um branch para a feature, termina, faz merge na master e pronto! Está entregue. O problema é que com isso, seu git fica cheio de branches que são, digamos: INÚTEIS. E claro que com o tempo esses branches se reproduzem como coelhos.

Como fazer para apagar todos esses branches? Você deve ter percebido que apenas um git branch -D meu-branch só apaga o branch no seu computador, e em nenhum remote.

Fácil, é só fazer o código git push origin :meu-branch, que além de ser nem um pouco claro (WTF?), te obriga a fazer isso um a um. Se forem muitos branches, babau!

@millermedeiros
millermedeiros / .htaccess
Created June 11, 2012 13:34
basic htaccess for perf
DirectoryIndex index.html index.htm index.php
ErrorDocument 404 /404
# Block directory listing
Options -Indexes
# === URL Rewrite === #
# Map all URIs except those corresponding to existing files/folders to the handler
RewriteEngine on
@drewjoh
drewjoh / custom.js
Created January 27, 2012 13:55
Dynamic (AJAX) loaded Bootstrap Modal (Bootstrap 2.1)
$(document).ready(function() {
// Support for AJAX loaded modal window.
// Focuses on first input textbox after it loads the window.
$('[data-toggle="modal"]').click(function(e) {
e.preventDefault();
var url = $(this).attr('href');
if (url.indexOf('#') == 0) {
$(url).modal('open');
} else {