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
// see for screenshot: | |
// https://twitter.com/paul_irish/status/829090506084749312 | |
const http = require('http'); | |
function requestHandler(request, response) { | |
const headers = { | |
'Server-Timing': ` | |
sql-1;desc="MySQL lookup Server";dur=100, | |
sql-2;dur=900;desc="MySQL shard Server #1", |
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
# block content | |
location ~ ^/content/(.*).(txt|md|mdown)$ { | |
rewrite ^/content/(.*).(txt|md|mdown)$ /error redirect; | |
} | |
# block all files in the site folder from being accessed directly | |
location ~ ^/site/(.*)$ { | |
rewrite ^/site/(.*)$ /error redirect; | |
} |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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
/* | |
You'll need something like this in your HTML: | |
<script src="http://d3js.org/topojson.v1.min.js"></script> | |
*/ | |
L.TopoJSON = L.GeoJSON.extend({ | |
addData: function(jsonData) { | |
if (jsonData.type === "Topology") { | |
for (key in jsonData.objects) { | |
geojson = topojson.feature(jsonData, jsonData.objects[key]); |