Skip to content

Instantly share code, notes, and snippets.

View gonzaloruizdevilla's full-sized avatar

Gonzalo Ruiz de Villa gonzaloruizdevilla

  • GFT
  • Madrid, Spain
View GitHub Profile
@gonzaloruizdevilla
gonzaloruizdevilla / LICENSE.txt
Last active August 29, 2015 14:08 — forked from 140bytes/LICENSE.txt
JavaScript curry function in 136 bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2014 Gonzalo Ruiz de Villa <adesis.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
// Directives
(function (angular) {
'use strict';
var filtroVisor = "filtrovisor";
function FilterVisor($timeout, $http, $q) {
return {
restrict: 'A',
require: '?ngModel',

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

var http = require('http'), httpProxy = require('http-proxy');
/**
* HTTP authentication module.
*/
var auth = require('http-auth');
/**
* Requesting new authentication instance.
*/
@gonzaloruizdevilla
gonzaloruizdevilla / gist:4168405
Created November 29, 2012 11:34 — forked from Mithrandir0x/gist:3639232
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@gonzaloruizdevilla
gonzaloruizdevilla / comma-first-var.js
Created April 16, 2012 10:23 — forked from isaacs/comma-first-var.js
Una mejor convención para codificar listas y literales de objetos en JavaScript
// Ver comentarios más abajo.
// Este ejemplo está basado en el original de
// Isaac Z. Schlueter, aka isaacs
// estilo estándar
var a = "ape",
b = "bat",
c = "cat",
d = "dog",
@gonzaloruizdevilla
gonzaloruizdevilla / rAF.js
Created March 23, 2012 20:11 — forked from paulirish/rAF.js
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller
// fixes from Paul Irish and Tino Zijdel
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
@gonzaloruizdevilla
gonzaloruizdevilla / LICENSE.txt
Created March 3, 2012 20:33 — forked from aemkei/LICENSE.txt
Lorenz Attractor - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@gonzaloruizdevilla
gonzaloruizdevilla / map.js
Created January 24, 2012 13:19 — forked from Jxck/map.js
Hadoop Streaming with Node.js
#!/usr/bin/env node
var stdin = process.openStdin();
var stdout = process.stdout;
var input = '';
stdin.setEncoding('utf8');
stdin.on('data', function(data) {
if (data) {
input += data;