Skip to content

Instantly share code, notes, and snippets.

View amatiasq's full-sized avatar

A. Matías Quezada amatiasq

View GitHub Profile
function banshee_application(checknum, pid, args) {
var app = new eyeos.application.Banshee(checknum, pid, args);
}
qx.Class.define("eyeos.application.Banshee", {
extend: eyeos.system.EyeApplication,
construct: function(checknum, pid, args) {
arguments.callee.base.call(this, 'banshee', checknum, pid);
Babel
Base16 color schemes
Cucumber
GitSavvy
Grunt
Gulp
Javsacript Beautify
JavascriptNext - ES6 Syntax
jsFormat
LESS
/* eslint no-multi-spaces:0 */
(function(root) {
var Firebase = root.Firebase;
var toArray = Function.prototype.call.bind(Array.prototype.slice);
window.FirebasePromise = FirebasePromise;
function DisconnectWrapper(disconnect) {
this._ref = disconnect;
}
@amatiasq
amatiasq / map.js
Last active August 29, 2015 14:23
(function() {
'use strict';
if (window.Map) return;
window.Map = FakeMap;
function FakeMap() {
this._keys = [];
this._values = [];
}
@amatiasq
amatiasq / mq-allow-external-clone.js
Created May 28, 2015 09:56
Directive to allow 3rd party libraries to clone angular nodes.
angular.module('my-module')
.directive('mqAllowExternalClone', function($compile) {
return {
link: link,
};
function link(scope, elem, attr) {
var element = elem[0];
var original = element.cloneNode;
element.cloneNode = patch;
@amatiasq
amatiasq / deep-extend.js
Created May 12, 2015 11:19
Deep extend for simple JSON objects
function deepExtend(target, source) {
Object.keys(source).forEach(function(key) {
var value = source[key];
var dest = target[key];
var sourceType = typeof value;
var destType = typeof target[key];
if (Array.isArray(value) && Array.isArray(dest))
target[key] = dest.concat(value);
else if (sourceType === destType && sourceType === 'object')
@amatiasq
amatiasq / eslint.yaml
Last active August 29, 2015 14:20
ESLint conf
env:
browser: true
globals:
define: true
rules:
# possible errors
comma-dangle: [1, "always-multiline"]
no-cond-assign: [2, "except-parens"]
@amatiasq
amatiasq / index.html
Last active October 6, 2016 15:47
Listen to Raygun errors from angular app
<script src="//cdn.raygun.io/raygun4js/raygun.min.js"></script>
<script>
Raygun.init('<TOKEN>', {
excludedHostnames: ['localhost'],
})
.attach()
.withCustomData(function() {
return {
hash: document.location.hash,
};
@amatiasq
amatiasq / race-condition.js
Created March 11, 2015 11:19
Solves a race condition issue on a Promise function: http://jsfiddle.net/amatiasq/zhmz8xdx/
function raceCondition(fn) {
var counter = 0;
return function() {
var index = ++counter;
var prom = fn.apply(this, arguments);
return new Promise(function(resolve, reject) {
prom.then(function(value) {
if (isLast()) resolve(value);
// Calculates the space closest to the middle of the name
function splitName(name) {
var middle = name.length / 2;
var spaces = [];
var last = name.indexOf(' ');
while(last !== -1) {
spaces.push(last);
last = name.indexOf(' ', last + 1)
}