Skip to content

Instantly share code, notes, and snippets.

@mloayzagahona
mloayzagahona / osx_setup.md
Created November 9, 2016 18:57 — forked from millermedeiros/osx_setup.md
Mac OS X setup.

Setup Mac OS X Mountain Lion or Mavericks

Edit: I few months ago I got a new laptop and did the same thing on Mavericks.

I just replaced the hard drive of my mbp and decided to do a clean install of Mountain Lion (10.8.5) since I was still using Snow Leopard (10.6.8).

I kinda regret for not using Boxen to automate the

@mloayzagahona
mloayzagahona / gulp.config.js
Created November 27, 2016 15:45 — forked from vintharas/gulp.config.js
Sample gulpfile for a complete pipeline with ES6 and SASS
/* eslint strict: [2, "global"] */
'use strict';
/*** Main paths ***/
var projectRoot = './',
root = './myProject.web/', // project root
index = root + 'Views/Shared/Layouts/',
src = root + 'Content/', // source code
temp = root + 'temp/', // temporary folder
dist = src + 'dist/', // generated code
@mloayzagahona
mloayzagahona / multiple_ssh_setting.md
Created November 29, 2016 14:37 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@mloayzagahona
mloayzagahona / *.md
Created December 10, 2016 04:34
Component versus Directive in AngularJS

Component versus Directive in AngularJS

.component()

Components are not "helper" methods, they are the best change in Angular 1.x since I've been using it.

What is the role of .component()?

  • Declares new HTML via a template or templateUrl
  • Should be used to create Components as part of a Component architecture
@mloayzagahona
mloayzagahona / $logDecorator.js
Created December 16, 2016 20:49
AngularJS - Disable logging
(function() {
var app = angular.module('myApp', []);
app.config(['$provide', function($provide) {
// decorates the $log instance to disable logging
$provide.decorator('$log', ['$delegate',
function($delegate) {
var $log, enabled = true;
$log = {
@mloayzagahona
mloayzagahona / gulp-tasks-scripts.js
Created December 17, 2016 15:22 — forked from hash-bang/gulp-tasks-scripts.js
Example Gulp task for scripts building using gulp-notify
/**
* Compile all JS files into the build directory
*/
var scriptBootCount = 0;
gulp.task('scripts', ['load:config'], function() {
var hasErr;
return gulp.src(paths.scripts)
.pipe(gplumber({
errorHandler: function(err) {
gutil.log(colors.red('ERROR DURING JS BUILD'));
@mloayzagahona
mloayzagahona / thoughts.md
Created December 17, 2016 15:37 — forked from floatdrop/thoughts.md
Error management in gulp

#Error management in gulp

Sucking at something is the first step to becoming sorta good at something

No one can assure you, that plugins will run smooth in any circumstances (except for tests - they could), so neither should you convince anyone, that your plugin will never break. Only thing, that you could possibly do (if something gone wrong) - is gracefully inform your plugin user, that something went wrong and die.

We are will use this plugin from beginning to demonstrate error management. Suppose you have a task in gulpfile.js that contains this code (we modified it a little bit to be closer to real-usage):

var coffee = require('gulp-coffee');
@mloayzagahona
mloayzagahona / bootstrap-breakpoints.sass
Created December 28, 2016 00:01 — forked from webinfinita/bootstrap-breakpoints.sass
Variables for responsive design in bootstrap with sass
@mixin breakpoint($point)
@if $point == lg
@media (min-width: 1200px)
@content
@else if $point == md
@media (min-width: 992px) and (max-width: 1199px)
@content
@else if $point == sm
app.directive('faFastScroll', ['$parse', function ($parse) {
var Interval = function(min, max) {
this.min = min || 0;
this.max = max || 0;
};
Interval.prototype.clip = function(min, max) {
if(this.max <= min || this.min >= max) {
this.min = this.max = 0;
@mloayzagahona
mloayzagahona / gist:f776b6479113e6565f26d32720ebb5c9
Created May 8, 2017 21:27 — forked from Bouke/gist:11261620
Multiple Python installations on OS X

Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv instead. If you are looking for the previous version of this document, see the revision history.

$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10

$ pyenv install 2.6.9