var arr = ['Foo', 'Bar']
console.log(`Olá
${arr[0]}
e
${arr[1]}`)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Template (.hbs) | |
var template = (function () { | |
var template = null; | |
$.ajax({ | |
type: 'GET', | |
dataType: 'html', | |
async: false, | |
url: 'templates/template.hbs', | |
success: function(res) { | |
template = res; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @desc Compile and execute handlebars and populate dest dir with markup | |
*/ | |
gulp.task('handlebars', function() { | |
/** | |
* @desc File that contains data to be compile and executed by Handlebars | |
* @type {json} | |
*/ | |
var handlebarsContext = require('./src/data.json'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ids = [ ... ]; | |
ids.forEach(function(id, i){ | |
callApi(id); | |
}); | |
function callApi(videoId) { | |
$.ajax({ | |
type: 'GET', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "id": 11, "name": "Mr. Foo" }, | |
{ "id": 12, "name": "Narco Bar" }, | |
{ "id": 13, "name": "Bombasto" }, | |
{ "id": 14, "name": "Celeritas" }, | |
{ "id": 15, "name": "Magneta" }, | |
{ "id": 16, "name": "RubberMan" }, | |
{ "id": 17, "name": "Dynama" }, | |
{ "id": 18, "name": "Dr IQ" }, | |
{ "id": 19, "name": "Magma" }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Wikipedia | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://en.wikipedia.org/* | |
// @match https://pt.wikipedia.org/* | |
// @grant none | |
// @import https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const session = require('express-session'); | |
const passport = require('passport'); | |
const cookieParser = require('cookie-parser'); | |
const fs = require('fs'); | |
const https = require('https'); | |
const cfenv = require('cfenv'); | |
const axios = require('axios'); | |
const settings = require('./settings.js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias list='f() { | |
cd /Users/emerson/Projects/$1; | |
printf "Please select folder:\n" | |
select d in */; do test -n "$d" && break; echo ">>> Invalid Selection"; done | |
cd "$d" | |
};f' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function aboveAverage(numbers = []) { | |
let total = numbers.reduce((acc, curr) => acc + curr, 0); | |
let average = total / numbers.length; | |
let aboveAverage = numbers.filter(number => number > average); | |
return aboveAverage.length; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Kills port | |
function kill-port() { | |
echo 'Killing port ' $1 | |
kill $(lsof -t -i :$1) | |
echo 'Killed port ' $1 | |
} |
OlderNewer