Skip to content

Instantly share code, notes, and snippets.

View cognivator's full-sized avatar

cognivator cognivator

View GitHub Profile
@cognivator
cognivator / showAllStates.md
Last active July 26, 2016 17:34
showStates - console function to extract the configured states of ui-router and print them to the console as a JSON tree.

Usage

At the Javascript console, run showAllStates() to see a JSON tree of the currently configured ui-router states as returned by $state.get().

Installation

Copy showStates code below into your Javascript console (tested with Chrome Devtools), and execute it to create the showStates function. Optionally, create similar functions in the console with the other scripts in this gist.

showAllStates = function () {
	var $injector = angular.element('html').injector(),
@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