Skip to content

Instantly share code, notes, and snippets.

@ambroisemaupate
ambroisemaupate / security.conf
Last active December 10, 2025 14:11
Nginx CSP example
# 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
@tyndyll
tyndyll / get_gmail.py
Created February 10, 2015 15:18
Extract Mail from GMail and Import into Neo4J
#!/usr/local/env python
import argparse
import email
import extract
import getpass
import imaplib
import os
import sys
import uuid
@rveciana
rveciana / README.md
Last active January 17, 2023 12:11
d3-composite-projections conicConformalSpain
<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">
@brycebaril
brycebaril / output.md
Last active February 23, 2020 22:35
process.nextTick vs setImmediate

@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
@cpietsch
cpietsch / README.md
Last active May 22, 2025 12:36
d3.js map with markers

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)
@chriswhong
chriswhong / index.html
Last active August 28, 2019 18:55
Time block charts wth D3
<!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;
@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

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

@btroncone
btroncone / ngrxintro.md
Last active February 26, 2026 10:29
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

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