Skip to content

Instantly share code, notes, and snippets.

@GriffinSauce
GriffinSauce / .hyper.js
Last active April 24, 2018 07:42
Hyper Terminal Config
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 13,
// font family with optional fallbacks
@GriffinSauce
GriffinSauce / algolia-search-hook.js
Last active November 28, 2020 18:25
A hook and context for algoliasearch/lite
import React, { useState, useEffect, useContext, useRef } from 'react';
import algoliasearch from 'algoliasearch/lite';
const algoliaClient = algoliasearch(ALGOLIA_APP_ID, ALGOLIA_API_KEY);
const SHOW_LOADING_AFTER_MS = 300;
/**
* Initialize a search
*
* @example:
@GriffinSauce
GriffinSauce / keybase.md
Created June 8, 2020 09:48
Keybase proof

Keybase proof

I hereby claim:

  • I am griffinsauce on github.
  • I am jorisgriffioen (https://keybase.io/jorisgriffioen) on keybase.
  • I have a public key ASDAwB1MI4Ly9Ogc9XYL0t_DXriUWoGPNlQQIErf0g3Rjwo

To claim this, I am signing this object:

[Intro / refrein]
TODO
[Couplet 1]
TODO
[Refrein]
TODO
[Couplet 2 - deel 1 (dansbreak)]
const http = require('http');
const log = console.log;
console.log = (...args) => {
log.apply(console, [new Date().toISOString()].concat(args));
};
const port = process.argv[2];
const server = http.createServer((req, res) => {
console.log('Incoming request');
@GriffinSauce
GriffinSauce / PirateMidi-SmartMessageEncoding.md
Created August 21, 2022 01:28
Pirate MIDI smart message encoding

Smart message encoding

Pirate MIDI smart messages are encoded into midi data format. The status byte is 0x70 for any type (ie. "70" in exported JSON), the parameters are encoded into dataByte1 and dataByte2, see below.

Message dataByte1 dataByte2
Switch on switch index (int) primary (0) or secondary (1)
Switch off switch index (int) primary (0) or secondary (1)
Switch toggle switch index (int) primary (0) or secondary (1)
Sequential reset step switch index (int)
@GriffinSauce
GriffinSauce / destination-input.js
Created November 7, 2022 20:58
Algolia Destination Autocomplete
const {autocomplete, getAlgoliaResults} = window['@algolia/autocomplete-js']
const ALGOLIA_APP_ID = '<APP ID>'
const ALGOLIA_API_KEY = '<API KEY>'
const ALGOLIA_INDEX_NAME = '<INDEX NAME>'
const SUPPORTED_LOCALES =
'ar da de en es fi fr he hu id it ja ko ms nl no pl pt pt-BR ru sv th tr zh zh-CN zh-HK zh-TW'
const DEFAULT_LOCALE = 'en'