Skip to content

Instantly share code, notes, and snippets.

View alexortiz201's full-sized avatar

Alex Ortiz alexortiz201

View GitHub Profile
@alexortiz201
alexortiz201 / sampleBufferFunction
Last active August 29, 2015 13:57
Buffer function for saving to DB, this prevents chattiness across the wire by waiting till user stops interacting with model.
RV.Profile.prototype.save = function () {
var delay = 3000,
self = this;
function saveProfile(args) {
self = args[0];
// cache
args[0].saveDB().then(function () {
RV.utils.profileLocalStore.updateNEW(self);
@alexortiz201
alexortiz201 / cssLoaderSample
Created March 20, 2014 18:51
CSS loader, used to load modular css before concatenating and minifying into one file
/******************************************************
Authored By: Alex Ortiz
last updated: March 5, 2014
This is the cssloader which gets files that will be
concat/min for prod
--------------
Sample CSS
@alexortiz201
alexortiz201 / stash.min.js
Created March 20, 2014 18:56
stash.min.js with a minor edit prevent IE8 from blowing up
// Stash v1.2.4 MIT/GPL2 @rezitech
(function(a,b,c){function k(a,c,e){var f=b[a],g;if(e){g=i(f);if(d(Array,g))c=g.concat(c);else if(d(Boolean,g))c=g&&!!c;else if(d(Date,g)&&!isNaN(c*1))c=new Date(g.getTime()+c*1);else if(d(Function,g)&&d(Function,c))c=new Function("return("+String(g)+").apply(this, arguments)&&("+String(c)+").apply(this, arguments)");else if(d(Number,g)&&!isNaN(c*1))c=g+c*1;else if(d(Object,g)&&d(Object,c))c=j(g,c);else if(d(RegExp,g)&&d(RegExp,c)){var k=/^\/([\W\w]*)\/([a-z]*?)$/,l=String(g).match(k),m=String(c).match(k);c=new RegExp(l[1]+m[1],l[2]+m[2])}else if(d(String,g))c=g+String(c);else return 2}c=h(c);if(f===c)return 2;return(b[a]=c)&&1}function j(){var a={},b=arguments,c=b.length,e=-1,f;while(++e<c)if(d(Object,b[e]))for(f in b[e])a[f]=d(Object,a[f])&&d(Object,b[e][f])?b.callee(a[f],b[e][f]):b[e][f];return a}function i(b){return(new Function("var a=arguments;h=a[0];return "+b)).apply(a,[f])}function h(b){var f=arguments.callee,h=[],i,j=-1,k;if(d(String,b))return e(b);if(b===undefined|
@alexortiz201
alexortiz201 / circleTransEffectHvr
Last active August 29, 2015 13:58
Class to do the a circle transition hover
#header .navToggle {height: 40px; width:40px; padding: 0; background: #043669; float:right; margin:35px 0 15px;
font-size: 32px;line-height:36px; color:#fff;
border: 2px solid #1589FF;
-webkit-border-radius: 90px;
-moz-border-radius: 90px;
border-radius: 90px;
transition: background-color 0.5s ease;
}
#header .navToggle:hover {cursor: pointer; background: #1589FF;}
@alexortiz201
alexortiz201 / simpleSlider
Created April 4, 2014 18:49
simple slider w/background img headline and paragraph
$(function () {
var slides = [],
liSize = $(window).width(),
autoplay = true,
step = 1,
current = 0,
maximum = 0,
visible = 1,
speed = 200,
@alexortiz201
alexortiz201 / rv.camera.js
Created May 12, 2014 14:09
Camera module for editor, pieces taken from david walsh's e.g.
/*
//styles
.modal-nav li { width:16.6%; float: left; cursor:pointer;padding:10px 0px; margin: 0 auto; text-align: center;}
.modal-nav li:last-child {width:17%;}
// button
<li data-state="camera"><img src="/assets/images/icons/icon-camera.png" alt="Camera" /></li>
@alexortiz201
alexortiz201 / BSProgressBar
Created July 14, 2014 18:12
bootstrap actual html layout for .less compiled css V3.0.3
<div class="progress progress-striped active">
<div class="progress-bar" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%">
<span class="sr-only">Loading</span>
</div>
</div>
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
@alexortiz201
alexortiz201 / hoverIntentMixin
Created August 21, 2014 16:49
.less hover intent mixin
.hover-intent(@delay){
transition: all .25s ease-out;
transition-delay:@delay;
}

Fixing npm On Mac OS X for Homebrew Users

If you just want to fix the issue quickly, scroll down to the "solution" section below.

Explanation of the issue

If you're a Mac Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together. If you install node with Homebrew and then try to do npm update npm -g, you will see an error like this:

$ npm update npm -g