This file contains hidden or 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"/> | |
<title>JSON to CSV</title> | |
<!--Mobile Specific Metas--> | |
<meta name="viewport" content="width=device-width, initial-scale=1"/> | |
<!--Font--> |
This file contains hidden or 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
Show hidden characters
// Documentation: jscs.info/rules | |
// Based on Airbnb's JavaScript Style Guide, URL: https://github.com/airbnb/javascript | |
{ | |
"preset": "airbnb", | |
"validateIndentation": 4 | |
} |
This file contains hidden or 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
<style> | |
.company-popup { | |
background: red; | |
height: 300px; | |
position: absolute; | |
right: -150px; | |
transition: right .2s linear; | |
width: 200px; | |
} |
This file contains hidden or 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 promiseExample(window, $, output, Math, Promise, setTimeout) { | |
var TIMEOUT = 2000; | |
var promise = null; | |
// Native | |
// Only call the Promise example if promises are supported in the browser natively | |
if (Promise !== undefined) { | |
// Create a new native promise object | |
promise = new Promise(function promise(resolve, reject) { |
This file contains hidden or 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 closest(element, fn) { | |
return element && (fn(element) ? element : closest(element.parentNode, fn)); | |
} |
This file contains hidden or 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
https://www.samclarke.com/2013/06/javascript-is-font-available/ |
This file contains hidden or 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 dom = (function dom(window, document) { | |
// Based on the idea of jQuery 3 | |
var _resolveReady; | |
var _isReady = false; | |
var _listReady = new window.Promise(function promiseReady(resolve) { | |
_resolveReady = resolve; | |
}); | |
// Check if the DOM has completed loading or is not in a loading state | |
if (document.readyState === 'complete' || document.readyState !== 'loading') { |
This file contains hidden or 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
<?php | |
// Prevent content sniffing attacks such as http://mths.be/bst. | |
header('X-Content-Type-Options: nosniff'); | |
// Note: The user-provided callback name must be filtered to prevent attack | |
// vectors. This script simply removes any symbols other than `[a-zA-Z0-9$_]` | |
// from the input. Sadly, this blocks the use of some valid JavaScript | |
// identifiers, and also accepts a few invalid ones. See | |
// http://mathiasbynens.be/notes/javascript-identifiers for details. |
This file contains hidden or 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
// Idea 1: https://medium.com/@bluepnume/learn-about-promises-before-you-start-using-async-await-eb148164a9c8#.s6914ps6a | |
// Use: https://babeljs.io/repl/ to transpile as ES5 | |
async function asyncDemo() { | |
try { | |
const res = await getJSON() // Promise.all([getJSON(), getJSON()]) for concurrent requests | |
console.log(res.value) | |
} catch (err) { | |
console.log(err) | |
} |