A guide for experienced programmers learning JavaScript and React.
- [Effective JavaScript][effectivejs] covers advanced JavaScript topics, such as concurrency and library design, in great detail.
const t = require('babel-types'); | |
const assert = require('assert'); | |
/** | |
* Is `module.exports` expression | |
*/ | |
const isModuleExportsMemberExpression = (node) => { | |
t.assertMemberExpression(node); | |
t.assertIdentifier(node.object); | |
assert.equal(node.object.name, 'module'); |
A number of fonts are available by default based on the platform (e.g., Roboto on Android, Helvetica on iOS). See the full list here.
const glob = require('glob'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const ROOT_PATH = path.resolve(`${__dirname}/..`); | |
// Get paths to all readable-stream packages in the dependency tree | |
function getPackagePaths(rootPath, packageName) { | |
return glob.sync(`${rootPath}/**/node_modules/${packageName}`); | |
} |
Babel 5 will incorrectly allow a let
declration shadow an outter var
declaration. See below and note the user of var _filters
on line 7 by Babel 6 instead of var filters
by Babel 5 (which shadows the var filters
declared on line 2).
# Determines how many cpus the virtual machine should be given. Uses half of | |
# what's available on the host with a default of 4. | |
def numvcpus | |
begin | |
os_cpu_cores / 2 | |
rescue | |
4 | |
end | |
end |
Shortcut to perform a Google I'm Feeling Lucky search on https://developer.mozilla.org.
diff --git a/data/stops.txt b/data/stops.txt | |
index 4e9c24e..200a82d 100644 | |
--- a/data/stops.txt | |
+++ b/data/stops.txt | |
@@ -1,96 +1,68 @@ | |
-stop_id,stop_code,stop_name,stop_desc,stop_lat,stop_lon,zone_id,stop_url,location_type,parent_station,platform_code | |
-70011,70011,"San Francisco Caltrain",, 37.776390,-122.394992,1,,0,ctsf,NB | |
-70012,70012,"San Francisco Caltrain",, 37.776348,-122.394935,1,,0,ctsf,SB | |
-70021,70021,"22nd St Caltrain",, 37.757599,-122.391880,1,,0,ct22,NB | |
-70022,70022,"22nd St Caltrain",, 37.757583,-122.392404,1,,0,ct22,SB |
I'm seeing this crash happen in a node http service running the newrelic agent. It seems to happen in this context:
req.end()
and req.destroy()
are called on the request that caused the errorserver.close()
is called on the http serverI am using node v4.2.3 and newrelic agent 1.24.0.