Skip to content

Instantly share code, notes, and snippets.

View jimniels's full-sized avatar

Jim Nielsen jimniels

View GitHub Profile
@jimniels
jimniels / quadratic-file.grid
Last active March 8, 2023 20:47
Quadratic file example
{
"cells": [
{
"x": 0,
"y": 0,
"type": "TEXT",
"value": "You successfully imported a file from a URL!",
"last_modified": "2023-03-08T20:40:55.629Z"
}
],
@jimniels
jimniels / feed.json
Last active December 24, 2023 00:12
automated gist update
{
"version": "https://jsonfeed.org/version/1",
"title": "Jim’s Microblog",
"home_page_url": "https://microblog.jim-nielsen.com/",
"feed_url": "https://microblog.jim-nielsen.com/feed.json",
"items": [
{
"date_published": "2023-12-24T00:12:27Z",
"content_text": "re: https://microblog.jim-nielsen.com/#20221130173429\r\n\r\nThis is actually a pretty cool way to do replies. I like it."
},
@jimniels
jimniels / feed.json
Last active December 14, 2023 02:44
automated gist update
{
"version": "https://jsonfeed.org/version/1",
"title": "Jim’s Microblog | STAGING",
"home_page_url": "https://microblog.jim-nielsen.com/",
"feed_url": "https://microblog.jim-nielsen.com/feed.json",
"items": [
{
"date_published": "2023-12-14T02:44:41Z",
"content_text": "Test this again"
},
@jimniels
jimniels / ephmeralist.html
Created April 22, 2022 21:38
Random Snippets
<!DOCTYPE html>
<title>Ephemeralist</title>
<style>
body {
max-width: 800px;
font-family: sans-serif;
}
img {
max-width: 100%;
height: auto;
@jimniels
jimniels / netlify-analytics-digest.js
Last active October 2, 2022 17:08
Example code that pulls data from the Netlify Analytics API (unofficial, v2) and creates HTML that can be sent in an email. Read more: https://blog.jim-nielsen.com/2022/netlify-analytics-email-digest/
const fetch = require("node-fetch");
const now = Date.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(
`ranking/sources?from=${oneDayAgo}&to=${now}&limit=100&timezone=-0700&resolution=hour`
// The idea axplained here:
// https://blog.jim-nielsen.com/2021/feed-urls/
// deno run --allow-net parse-feed-urls.js
import { DOMParser } from "https://deno.land/x/deno_dom@v0.1.13-alpha/deno-dom-wasm.ts";
import * as path from "https://deno.land/std@0.106.0/path/mod.ts";
import { parse } from "https://cdn.skypack.dev/tldts";
const urls = await getFeedUrls();
const urlCollection = createUrlCollection(urls);
console.log("test");
@jimniels
jimniels / _pac.md
Last active May 24, 2019 13:28
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: