Skip to content

Instantly share code, notes, and snippets.

View cognivator's full-sized avatar

cognivator cognivator

View GitHub Profile
@cognivator
cognivator / gitignore-cache-clean.sh
Last active April 17, 2016 03:36
.gitignore cache cleaning
#!/bin/bash
# Run this from the root of a git repo - AFTER YOU COMMIT THE CHANGES YOU CARE ABOUT!
# Then, if you need to keep the deleted files in your working copy (e.g. IDE config files),
# be sure to unstage them before your next commit.
# attribution: http://www.randallkent.com/2010/04/30/gitignore-not-working/
for file in `cat .gitignore` ; do git rm -r --cached $file; done
@cognivator
cognivator / exd_noclutter
Created April 4, 2016 22:45
Prevent OSX clutter on external storage
#!/bin/bash
# protect an ext drive (USB, memcard, etc) from the following files:
# .Spotlight-V* (Spotlight index)
# .Trashes (Deleted files)
# .fseventsd/* (journaling)
# .DS_Store (finder prefs... not implemented, yet)
# run this from the root of the drive that should be protected