Skip to content

Instantly share code, notes, and snippets.

View antenando's full-sized avatar

Fernando Bueno antenando

View GitHub Profile
@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!");
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
html {
cursor: none;
}
Verifying that "antenando.id" is my Blockstack ID. https://onename.com/antenando
@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 / all-wordpress-posts.php
Created April 6, 2017 21:34
All Wordpressssssssss Posts
<?php
/*
Template Name: Query
*/
?>
<?php get_header(); ?>
<div class="page-content page-explore">
<?php get_template_part('includes/feature','top'); ?>
var StickyFooter = (function ($) {
var $body = $('html, body');
var $footer = $body.find('.main-footer');
var $CTAfooter = $body.find('.cta-footer');
function init() {
if ($footer.length && $CTAfooter.length) {
checkFooter();
triggerEventScrolling(checkFooter);
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']);
function StairCase(n) {
var printLine = function(y, t){
var line = '';
for (var j = 0; j <= t; j++) {
if (j < y) {
line += ' ';
} else if (j > y){
line += '#';
}

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