Skip to content

Instantly share code, notes, and snippets.

View antenando's full-sized avatar

Fernando Bueno antenando

View GitHub Profile
@antenando
antenando / truth_table.js
Created May 13, 2016 15:30 — forked from yarwelp/truth_table.js
Truth table (JavaScript)
/* js-truth_table
*
* file: truth_table.js
*
* Copyright (c) 2011, Erik Nordstroem <contact@erikano.net>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
@antenando
antenando / chai-expect.md
Created July 18, 2016 05:20 — forked from patocallaghan/chai-expect.md
Chai Expect Assertion library examples. From http://chaijs.com/api/bdd/ #chai #javascript #expect

##Chai Expect

##Language Chains

  • to
  • be
  • been
  • is
  • that
  • and
  • have
import Ember from 'ember';
export default Ember.Controller.extend({
init: () => console.clear()
});

📈📈📈📈📈📈📈📈📈📈📃💳🚬➗➕🔝🎥🔛🔛🔌🔌🔨🔨💱🔌🔨🎓💣🍢🍢🐗🚬💼🍜⛅⛅⛅⛅⛅⛅⛅⛅😰😰😰
📈📈📈📈📈📈📈📈📈📈📝🐑🎓🔌💱🔨🔌💱🎥🔝🔝🔨🔨🔌🔌🔝🎓🎓🍢🎏🌷🚬🛀🍜⛅⛅⛅⛅⛅⛅⛅😰😰😰😰
📈📈📈📈📈📈📈📈📈📈🎂🎊🎓🔨➗💱🔃🔌🔛🚏🚏🔝🔨🎓🎓🎓🚏🎓🚬🎌🌷🎏🎳🔏😰⛅⛅⛅⛅⛅⛅😰😰😰😰
📈📈📈📈📈📈📈📈📈📃🐶🍢🎓🔌➕🔌💱🔛🔛🎓🎓🎓🔝🎼💣🎓🐗💣🚬🍡🐘🛀🎳⛪💳⛅⛅⛅⛅⛅😰😰😰😰😰
📈📈📈📈📈📈📈📈📈📃⛪🎓🎣🔚🔛🎓🔝🎓🎥🔝🔝🎥🔪🔎🔪🎣🌷🍢🐗🛀💀🛀🎳💀🐶⛅⛅⛅⛅⛅⛅😰⛅😰😰
📈📈📈📈📈📈📈📈📈🎂🛀🎓🎣🔨🔝🎼🚏🎣🎓🔝🔝🔝🔗🔊🎣🎼🎏🎳🌷🎳👟🐰🐰🐰🍲⛅⛅⛅⛅⛅⛅😰😰😰😰
📈📈📈📈📈📈📈📈📃🐚🚬🎓🎣🎓🎣💣🎼🎓🎓🎣🔝🎓🎧🔊🚥🎼🔎💀💀🌷👀🐚🔘👟💴🍜⛅⛅⛅⛅⛅⛅😰😰😰
📈📈📈📈📈📈📈📈📝⛪💣💣🚏💣💣🐗🎼🎓🎓🎣🔝🔝🌷🚬💣💣🚥🎳💀🚽🎳🔘🔘💀⛪🍜😰⛅⛅⛅⛅⛅😰😰😰
📈📈📈📈📈📈📈📈📩🍱💣💣🎓🐡🌷🐗🎣🎣🎓🎣🎓🎓🌷💣🚏🚏🔻🌷🛀🐰💀👀👀💀🐰🍜😰⛅⛅⛅⛅😰😰😰😰
📈📈📈📈📈📈📈📈🐚🌷🎓🎣💣🌷🚬💣🎓🔻🐗🐗💣💣🚬💣💣🐗🔻🐗🌷🌷💀💀💀🐰🐰🍜😰⛅⛅⛅⛅😰🐹😰😰

const MODULE_DIR = /(.*([\/\\]node_modules|\.\.)[\/\\](@[^\/\\]+[\/\\])?[^\/\\]+)([\/\\].*)?$/g;
{
loader: 'babel-loader',
test: /\.jsx?$/,
include(filepath) {
if (filepath.split(/[/\\]/).indexOf('node_modules')===-1) return true;
let pkg, manifest = path.resolve(filepath.replace(MODULE_DIR, '$1'), 'package.json');
try { pkg = JSON.parse(fs.readFileSync(manifest)); } catch (e) {}
return !!(pkg.modules || pkg['jsnext:main']);
@antenando
antenando / function_invocation.js
Created April 7, 2017 21:33 — forked from myshov/function_invocation.js
11 Ways to Invoke a Function
console.log(1);
(_ => console.log(2))();
eval('console.log(3);');
console.log.call(null, 4);
console.log.apply(null, [5]);
new Function('console.log(6)')();
Reflect.apply(console.log, null, [7])
Reflect.construct(function(){console.log(8)}, []);
Function.prototype.apply.call(console.log, null, [9]);
Function.prototype.call.call(console.log, null, 10);
@antenando
antenando / protips.js
Created May 17, 2017 04:37 — forked from nolanlawson/protips.js
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
# Thanks to this post:
# http://blog.ikato.com/post/15675823000/how-to-install-consolas-font-on-mac-os-x
$ brew install cabextract
$ cd ~/Downloads
$ mkdir consolas
$ cd consolas
$ curl -O http://download.microsoft.com/download/f/5/a/f5a3df76-d856-4a61-a6bd-722f52a5be26/PowerPointViewer.exe
$ cabextract PowerPointViewer.exe
$ cabextract ppviewer.cab
@antenando
antenando / bling.js
Created September 1, 2017 17:17 — forked from paulirish/bling.js
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;