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
<html> | |
<body> | |
<script> | |
function createString() { | |
return "0".repeat(25 * 1024 * 1024).substring(0, 11); | |
} | |
var arr = []; | |
setInterval(function() { |
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
// Let's get hold of those elements | |
var outer = document.querySelector('.outer'); | |
var inner = document.querySelector('.inner'); | |
// Let's listen for attribute changes on the | |
// outer element | |
new MutationObserver(function() { | |
console.log('mutate'); | |
}).observe(outer, { | |
attributes: true |
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
module.exports = { | |
apps: [{ | |
name: 'Exercise Tracker', | |
cwd: './boilerplate-exercisetracker', | |
script: './server.js', | |
instances: 1, | |
autorestart: true, | |
watch: false, | |
max_memory_restart: '70M', | |
exp_backoff_restart_delay: 100, |
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
/** | |
* subscriptions data format: | |
* { eventType: { id: callback } } | |
*/ | |
const subscriptions = { } | |
const getNextUniqueId = getIdGenerator() | |
function subscribe(eventType, callback) { | |
const id = getNextUniqueId() |
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
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.2/d3.min.js"></script> | |
<script src="https://unpkg.com/c3@0.6.8/c3.js"></script> | |
<link href="https://unpkg.com/c3@0.6.8/c3.css" rel="stylesheet"> | |
<div id="chart"></div> | |
<script> | |
var chart = c3.generate({ | |
bindto: '#chart', | |
data: { | |
columns: [ |
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
<script> | |
var chart = c3.generate({ | |
bindto: '#chart', | |
data: { | |
columns: [ | |
['data1', 30, 200, 100, 400, 250], | |
['data2', 50, 20, 10, 40, 25], | |
['data3', 150, 10, 40, 40, 15], | |
['data4', 80, 40, 70, 20, 45], | |
['data5', 30, 60, 35, 90, 40] |
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
d.sort(function(a, b){ | |
return a.value - b.value; | |
}); |
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
contents: function (d, defaultTitleFormat, defaultValueFormat, color) { | |
var $$ = this, config = $$.config, | |
titleFormat = config.tooltip_format_title || defaultTitleFormat, | |
nameFormat = config.tooltip_format_name || function (name) { return name; }, | |
valueFormat = config.tooltip_format_value || defaultValueFormat, | |
text, i, title, value, name, bgcolor; | |
d.sort(function(a, b){ | |
return a.value - b.value; | |
}); | |
for (i = 0; i < d.length; i++) { |
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 objects = [{'Name': 'John', 'Age': 23, 'Profession': 'Accountant'}, | |
{'Name': 'Adam', 'Age': 18, 'Profession': 'Engineer'}, | |
{'Name': 'Vik', 'Age': 46, 'Profession': 'Architect'}, | |
{'Name': 'Jane', 'Age': 36, 'Profession': 'Developer'}, | |
{'Name': 'Rikky', 'Age': 28, 'Profession': 'Developer'}]; |
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
sortBy(objects, 'Profession', {'Name': 'desc'}); | |
console.table(objects); |
OlderNewer