Skip to content

Instantly share code, notes, and snippets.

View evanrs's full-sized avatar
🏋️‍♂️
Focusing

Evan Schneider evanrs

🏋️‍♂️
Focusing
View GitHub Profile
@evanrs
evanrs / factory.js
Created April 17, 2014 04:09
Angular Route Factory
var routeFactory = {
build: function(components, routes){
components = _.reduce(components, function (accumulator, component, index) {
if(_.isEmpty(accumulator)) return component
if(_.isString(accumulator)) accumulator = [accumulator]
var transform = accumulator.slice(0)
_.map(accumulator, function(route){
var slug = component
if(slug[0] === '/') slug = slug.slice(1)
else if(slug[0] === ':'){}
@evanrs
evanrs / .gitconfig
Created March 17, 2014 19:03
git.deprecate — delete remote and local branches named by arguments
[alias]
deprecate = "!f(){ for ORIGIN in $@; do if [ $ORIGIN == master ] || [ $ORIGIN == HEAD ] || [ $ORIGIN == develop ]; then echo $ORIGIN is not allowed; continue;fi; echo $ORIGIN; git branch -d $ORIGIN; git push origin --delete $ORIGIN; done; }; f"
@evanrs
evanrs / todo.md
Created March 12, 2014 19:31
Prune old issues by pinging creators to resolve or close them.
@evanrs
evanrs / gist:8809802
Created February 4, 2014 18:48 — forked from remy/gist:350433
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () {
var Storage = function (type) {
function createCookie(name, value, days) {
var date, expires;
if (days) {
date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();
<script type="text/ng-template" id="one.html">
<div>This is first template</div>
</script>
<script type="text/ng-template" id="two.html">
<div>This is second template</div>
</script>