Skip to content

Instantly share code, notes, and snippets.

View aozora's full-sized avatar

aozora aozora

View GitHub Profile
@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active October 24, 2024 18:10
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@joshstrange
joshstrange / fetchGraphQLSchema
Created June 26, 2018 18:36
Fetch graphql schema and save to file
#!/usr/bin/env node
const os = require('os');
const request = require('request-promise-native');
const fs = require('mz/fs');
let hostname = os.hostname();
let baseUrl = 'YOUR_BASE_URL';
(async () => {
let jwt = await getJwt();