Skip to content

Instantly share code, notes, and snippets.

View johnoscott's full-sized avatar

Johno Scott johnoscott

View GitHub Profile
@johnoscott
johnoscott / vaultspeed-docker.md
Created January 8, 2026 03:13
Dockerfile and Docker Compose VaultSpeed Agent

Define a JDK Docker image

FROM openjdk:11-slim-bullseye  
  
# install:  
# - ca-certificates required by OpenJDK 11  
# - git for VaultSpeed to perform a git deployment  
RUN apt-get update -y && \  
    apt-get dist-upgrade -y && \  
@johnoscott
johnoscott / Makefile
Last active November 24, 2025 07:55
Syncthing MacBook client setup script
.PHONY: download-scripts add-folder
GIST_URL = https://gist.githubusercontent.com/johnoscott/f5d5110ddec85cb04729fe8ef982eeb8/raw
download-scripts:
curl -sL $(GIST_URL)/setup-macbook-client.sh -o setup-macbook-client.sh
curl -sL $(GIST_URL)/add-sync-folder.sh -o add-sync-folder.sh
chmod +x setup-macbook-client.sh add-sync-folder.sh
@echo "Scripts downloaded"
# --------------------------------------------------------------
# Customer Support Ticket Classification System
# --------------------------------------------------------------
import instructor
from pydantic import BaseModel, Field
from openai import OpenAI
from enum import Enum
from typing import List
@johnoscott
johnoscott / file1.py
Created July 1, 2024 20:00
2024 Gist Sample
‎‎​
@johnoscott
johnoscott / vscode-macos-context-menu.md
Created March 3, 2023 22:02 — forked from idleberg/vscode-macos-context-menu.md
“Open in Visual Studio Code” in macOS context-menu

Open in Visual Studio Code

  • Open Automator
  • Create a new document
  • Select Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
    • your default shell should already be selected, otherwise use /bin/zsh for macOS 10.15 (”Catalina”) or later
    • older versions of macOS use /bin/bash
  • if you're using something else, you probably know what to do 😉
@johnoscott
johnoscott / docker-compose.yaml
Last active April 14, 2022 01:19 — forked from jdaarevalo/docker-compose.yaml
docker_compose_postgres
# https://hub.docker.com/_/postgres
# Usage:
# $ docker compose up
# NOTE: version not required as of compose spec v
# version: '3.7'
# docker run --name basic-postgres --rm \
# -e POSTGRES_USER=postgres \

Getting Started With Plug'n'Play

If you use create-react-app, #5136 (released with the 2.0) implements a --use-pnp option that allows you to easily create a new project using PnP! In this case, just use create-react-app --use-pnp together with Yarn 1.12, and you're good to go! 👍

Plug'n'Play is a new initiative from Yarn that aims to remove the need for node_modules. It's already available, and has proved being effective even on large-scale infrastructures. This document describes in a few steps how to quickly get started with it. Spoiler alert: it's quite easy 🙂

First, download a package manager that supports it. Yarn 1.12 already does, so that's what we're going to use! To install it, just follow the instructions on our website: https://yarnpkg.com/en/docs/install

If everything is ok, running yarn --version should give you v1.12.1 or higher. If you don't get this result maybe a

@johnoscott
johnoscott / ngrok-installation.md
Created August 5, 2021 01:48 — forked from wosephjeber/ngrok-installation.md
Installing ngrok on Mac

Installing ngrok on OSX

For Homebrew v2.6.x and below:

brew cask install ngrok

For Homebrew v2.7.x and above:

@johnoscott
johnoscott / babel_url_encoding.md
Last active August 2, 2021 22:37
babel url encoding for http get params
@johnoscott
johnoscott / macro.gs
Created July 12, 2021 19:23 — forked from jsjoeio/macro.gs
Google Spreadsheet macro example
/** @OnlyCurrentDoc */
const startDate = new Date("2021-06-16")
// so the first one is D2:K2
function MarkEmptyCellsInYesterdayRowWithHyphen() {
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Group 2 - B");
// Activates the sheet
SpreadsheetApp.setActiveSheet(sheet);
const today = new Date()