As easy as 1, 2, 3!
Updated:
- Aug, 08, 2022 update
config
docs for npm 8+ - Jul 27, 2021 add private scopes
- Jul 22, 2021 add dist tags
- Jun 20, 2021 update for
--access=public
- Sep 07, 2020 update docs for
npm version
The reflow appens as many times as there are frames per seconds. It recalculate all positions that change in order to diplay them. Basically, when you scroll you execute a function where you move things between two reflows. But there are functions that triggers reflows such as jQuery offset, scroll... So there are two things to take care about when you dynamically change objects in javascript to avoid too many reflows:
<div id="map-buttons" class="btn-group" data-toggle="buttons-checkbox"> | |
<button id="layer1" class="btn active">Layer 1</button> | |
<button id="layer2" class="btn active">Layer 2</button> | |
<button id="layer3" class="btn active">Layer 3</button> | |
</div> | |
<script type="text/javascript"> | |
// Setup "layer" arrays | |
layer1Array = new Array(); | |
layer2Array = new Array(); |
var levelup = require("levelup") | |
var path = __dirname + "db" | |
var options = {encoding: "json"} | |
var db = levelup(path, options) | |
function id(cb) { | |
if (typeof cb != "function") throw new TypeError | |
if (!id.queue) { | |
id.queue = [] |
// data comes from here http://stat-computing.org/dataexpo/2009/the-data.html | |
// download 1994.csv.bz2 and unpack by running: cat 1994.csv.bz2 | bzip2 -d > 1994.csv | |
// 1994.csv should be ~5.2 million lines and 500MB | |
// importing all rows into leveldb took ~50 seconds on my machine | |
// there are two main techniques at work here: | |
// 1: never create JS objects, leave the data as binary the entire time (binary-split does this) | |
// 2: group lines into 16 MB batches, to take advantage of leveldbs batch API (byte-stream does this) | |
var level = require('level') |
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
$ nano ~/.zshrc
path=('/path/to/depot_tools' $path)