open coordinates-axios.html or coordinates-jquery.html in your browser.
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
// bad | |
let name = 'Emerson Broga'; | |
let hello = 'Hello ' + name; | |
// good | |
let name = 'Emerson Broga' | |
let hello = `Hello ${name}`; |
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 fs = require('fs'); | |
const path = require('path'); | |
const DEFAULT_PATH = './output/log.txt'; | |
const getAbsolutePath = (filePath) => { | |
const absolutePath = path.resolve(filePath); | |
const fileExists = fs.existsSync(absolutePath); | |
if (!fileExists) { | |
throw new Error(`File doesn't exist: ${absolutePath}`); |
This is a simple snippet to create a wordpress contact form that sends email using mailgun api.
. Install the mailgun plugin for wordrpess https://wordpress.org/plugins/mailgun/
. Add the config constants to your wp-config.php
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
input { | |
height: 30px; | |
width: 50%; |
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 Utils() {} | |
Utils.prototype = { | |
constructor: Utils, | |
isElementInView: function (element, fullyInView) { | |
var pageTop = $(window).scrollTop(); | |
var pageBottom = pageTop + $(window).height(); | |
var elementTop = $(element).offset().top; | |
var elementBottom = elementTop + $(element).height(); |
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 smoothScroll = { | |
timer: null, | |
stop: function () { | |
clearTimeout(this.timer); | |
}, | |
scrollTo: function (id, callback) { | |
var settings = { | |
duration: 1000, |
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
getAccountSports: function getAccountSports(accountId, callback) { | |
var allSports = ['lacrosse', 'soccer']; | |
var result = []; | |
Account.findOne(accountId).populate('events').then(function(account) { | |
// if admin return all sports. | |
if (account.type === 'admin') { | |
return callback(null, allSports); | |
} |