Skip to content

Instantly share code, notes, and snippets.

View VinSpee's full-sized avatar
🏠
Working from home

Vince Speelman VinSpee

🏠
Working from home
View GitHub Profile
@VinSpee
VinSpee / tailwind.config.js
Created January 30, 2023 20:23
tailwind config
const plugin = require('tailwindcss/plugin');
const spacing = {
auto: 'auto',
px: '1px',
0.5: '2px',
0: '0px',
1: '4px',
1.5: '6px',
2: '8px',
@VinSpee
VinSpee / generate.ts
Created January 14, 2023 00:56
I was able to add a little strategy around the retries, using [`got`](https://github.com/sindresorhus/got/blob/main/documentation/9-hooks.md#afterresponse) which implements an "exponential back off" (first retry happens in 1 second, then 2, then 4, then 8, then 16, etc etc, with a little variance to not make it look like a bot. Here's the code:
import got, { type RequestError } from "got";
import { env } from "~/env";
import { StatusCodes } from "http-status-codes";
const generateAction = async (request, response) => {
const result = await got
.post(env.HUGGINGFACE_MODEL_URL, {
hooks: {
afterResponse: [
(result, retryWithMergedOptions) => {
@VinSpee
VinSpee / tokens.css
Created February 18, 2021 15:18
ps-custom-properties
:root {
--ps-color-gray-50: #F9FAFB;
--ps-color-gray-100: #EEF0F2;
--ps-color-gray-200: #DEE4E8;
--ps-color-gray-300: #C2CDD6;
--ps-color-gray-400: #8E9EAC;
--ps-color-gray-500: #5F7482;
--ps-color-gray-600: #434F5C;
--ps-color-gray-700: #1E2B36;
--ps-color-blue-100: #EBF4FB;
@VinSpee
VinSpee / machine.js
Last active June 3, 2020 01:35
Generated by XState Viz: https://xstate.js.org/viz
const { log } = actions;
const apolloRequest = (data) => Promise.resolve(data);
const MOCK_RETURN_ACTION = {
type: 'ADD_VIDEO_TO_YOUR_LIST',
variables: {
id: "1755",
secondsPlayed: 0,
}
@VinSpee
VinSpee / machine.js
Last active May 14, 2020 16:55
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState
@VinSpee
VinSpee / machine.js
Last active November 15, 2019 18:59
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@VinSpee
VinSpee / machine.js
Last active November 12, 2019 17:24
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@VinSpee
VinSpee / machine.js
Last active October 29, 2019 20:26
Generated by XState Viz: https://xstate.js.org/viz
const inputActions = {
CHANGE: "input/change",
FOCUS: "input/focus",
BLUR: "input/blur"
};
const valid = "editing.dirty.valid";
const inputMachine = Machine(
{
@VinSpee
VinSpee / machine.js
Last active October 28, 2019 20:38
Generated by XState Viz: https://xstate.js.org/viz
const USER_HAS_AGREED_TO_WELCOME = false;
const USER_IS_LOGGED_IN = false;
const conversationMachine = Machine({
id: 'welcomeSequence',
initial: 'idle',
context: {
hasVisitedPrior: null,
user: null,
conversationSlug: null,
@VinSpee
VinSpee / userscript.js
Created June 4, 2019 17:49
Open links in BlueJeans
// ==UserScript==
// @name BlueJeans Open In App
// @namespace https://vinspee.me
// @version 0.1
// @license MIT
// @description Open BlueJeans meetings in the app
// @author Vince Speelman <v@vinspee.me>
// @match *://*.bluejeans.com/*
// @grant window.close
// @require https://cdn.rawgit.com/agnoster/base32-js/91f43b82f19f467ade1270aa4b0e579b201d7efd/dist/base32.min.js