Skip to content

Instantly share code, notes, and snippets.

View daveboster's full-sized avatar

Dave Boster daveboster

View GitHub Profile
@khpeet
khpeet / users-to-nrql.js
Last active February 16, 2024 11:44
Fetches user data from GraphQL, formats it, sends to NRDB as queryable events.
var got = require('got');
/* -------------------CONFIGURATION-------------------------------------- */
var API_KEY = '<user_key>'; //add as a secure cred - Used to fetch data via GraphQL - preferably a master account key
var INGEST_KEY = '<ingest_key>'; //add as a secure cred - Used to insert data into NRDB
var ACCOUNT_ID = 1 //account to post events to
var EVENT_TYPE = 'NrUsers'; //eventType (table) that data is stored in
/* -------------------CONFIGURATION-------------------------------------- */
var GRAPH_API = 'https://api.newrelic.com/graphql';
@MichaelCurrin
MichaelCurrin / README.md
Last active March 28, 2025 00:35
Jekyll - how to build a REST API

Jekyll - how to build a REST API

Serve your data as static JSON

How to make a read-only JSON REST API using Jekyll.

This doesn't need any Ruby plugins - you just use some built-in templating features in Jekyll 3 or 4.

You will end up with a single JSON file contains data for all pages on the site, and another JSON file of just posts. Alternatively, you can replace every HTML page and post with a JSON version.