Skip to content

Instantly share code, notes, and snippets.


Jim Nielsen jimniels

View GitHub Profile
View ephmeralist.html
<!DOCTYPE html>
body {
max-width: 800px;
font-family: sans-serif;
img {
max-width: 100%;
height: auto;
jimniels / netlify-analytics-digest.js
Last active May 15, 2022
Example code that pulls data from the Netlify Analytics API (unofficial, v2) and creates HTML that can be sent in an email. Read more:
View netlify-analytics-digest.js
const fetch = require("node-fetch");
const now =;
const oneDayAgo = now - 24 * 60 * 60 * 1000;
const { NETLIFY_BLOG_SITE_ID, NETLIFY_TOKEN } = process.env;
exports.handler = async function (event) {
try {
// Fetch the data
const sources = await fetchNetlify(
View parse-feed-urls.js
// The idea axplained here:
// deno run --allow-net parse-feed-urls.js
import { DOMParser } from "";
import * as path from "";
import { parse } from "";
const urls = await getFeedUrls();
const urlCollection = createUrlCollection(urls);
jimniels /
Last active May 24, 2019
Future of pac

Future of Pac (Rulesets, Dynamic Actions, etc.)

We want to cede control of Pac-related post bind policy actions to folks outside of the engineering group, namely Product and Product Implementation. This will be controlled in two different places

  1. The product will control visibility of postbind policy actions and their functionality on a product-by-product basis.
  2. Launch darkly flags will control visibility of postbind policy actions and their functionality on a user-by-user basis.

Note: the underlying assumption of the following solution is that every policy action (and accompanying rulesets feature functionality) is considered “turned off” for everyone by default. From there, each action is “turned on” through a combination of product form <Meta> tags and launch darkly flags.

A user will only be able to complete a particular post bind policy action IF: