Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
/* Use this to cause a function to fire no more than once every 'ms' milliseconds. | |
For example, an expensive mousemove handler: | |
$('body').mouseover(ratelimit(function(ev) { | |
// ... | |
}, 250)); | |
*/ | |
function ratelimit(fn, ms) { | |
var last = (new Date()).getTime(); |
function swap(items, firstIndex, secondIndex){ | |
var temp = items[firstIndex]; | |
items[firstIndex] = items[secondIndex]; | |
items[secondIndex] = temp; | |
} | |
function partition(items, left, right) { | |
var index = Math.floor((right + left) / 2), | |
pivot = items[index], | |
i = left, |
YUI.add('spring', function (Y) { | |
// do sth | |
}, '1.0.0', { | |
requires: ['yui', 'node-base'] | |
}); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div data-component="input"> |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
renderModel(model: IRenderMime.IMimeModel): Promise<void> { | |
// Retrieve Data Explorer persistent data and metadata | |
const data = model.data[this._mimeType] as JSONObject; | |
const metadata = (model.metadata.dataExplorer || {}) as JSONObject; | |
// Capture Data Explorer metadata changes and save them to notebook file in order to restore | |
const onMetadataChange = (data: object) => { | |
model.setData({ metadata: { ...model.metadata, dataExplorer: data } }); | |
const notebookPanel = findNotebookPanel(this); | |
if (notebookPanel) notebookPanel.context.save(); |