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
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
(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
<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
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
<!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
function josephus(array, count) { | |
// Return store | |
const store = []; | |
// Counter for each time the element should be spliced | |
let counter = 0; | |
// Array index position | |
let index = 0; | |
while (array.length > 0) { |
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
// Note: Save as Company.js and run 'babel-node Company.js' to display in the command window. This is written in ES2015 | |
const Company = ((window) => { | |
// Store an array of callbacks | |
const _callbacks = []; | |
// Store whether the 'init' function has already been called | |
let _isInitialised = false; | |
function init() { | |
_isInitialised = true; |
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
{ | |
"tern_argument_hints": true, | |
"tern_argument_hints_type": "tooltip", | |
"tern_argument_completion": true | |
} |