This file shows how to use the conicConformalPortugal projection from d3-composite-projections. The example is the same as the one at this block, but with this new composite projection gives a much better result.
| # config to don't allow the browser to render the page inside an frame or iframe | |
| # and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking | |
| # if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri | |
| # https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options | |
| add_header X-Frame-Options SAMEORIGIN; | |
| # when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header, | |
| # to disable content-type sniffing on some browsers. | |
| # https://www.owasp.org/index.php/List_of_useful_HTTP_headers | |
| # currently suppoorted in IE > 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx |
| #!/usr/local/env python | |
| import argparse | |
| import email | |
| import extract | |
| import getpass | |
| import imaplib | |
| import os | |
| import sys | |
| import uuid |
| <html> | |
| <head> | |
| <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css"/> | |
| <script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> | |
| <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script> | |
| <script src="leaflet-providers.js"></script> | |
| </head> | |
| <body> | |
| <div id="map" style="width: 100%; height: 300px;"></div> | |
| <script type="text/javascript"> |
@mafintosh asks: "Does anyone have a good code example of when to use setImmediate instead of nextTick?"
https://twitter.com/mafintosh/status/624590818125352960
The answer is "generally anywhere outside of core".
process.nextTick is barely asynchronous. Flow-wise it is asynchronous, but it will trigger before any other asynchronous events can (timers, io, etc.) and thus can starve the event loop.
In this script I show a starved event loop where I just synchronously block, use nextTick and setImmediate
| $ cf buildpacks | |
| Getting buildpacks... | |
| buildpack position enabled locked filename | |
| staticfile_buildpack 1 true false staticfile_buildpack-cached-v1.2.1.zip | |
| java_buildpack 2 true false java-buildpack-v3.1.zip | |
| ruby_buildpack 3 true false ruby_buildpack-cached-v1.6.1.zip | |
| nodejs_buildpack 4 true false nodejs_buildpack-cached-v1.5.0.zip | |
| go_buildpack 5 true false go_buildpack-cached-v1.5.0.zip | |
| python_buildpack 6 true false python_buildpack-cached-v1.5.0.zip |
Easy example on how to put marker on a d3.js map.
You got 2 options:
- using d3.geo.path() which does all the work for you
- using svg circles and translating them via projection(d.geometry.coordinates)
| <!DOCTYPE html> | |
| <html class="html"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"> | |
| <style> | |
| .axis text { | |
| font: 10px sans-serif; |
If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.
Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.
If in doubt about what git is doing when you run these commands, just
By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents