Skip to content

Instantly share code, notes, and snippets.

View jadenlemmon's full-sized avatar
🚀
Hacking away

Jaden Lemmon jadenlemmon

🚀
Hacking away
View GitHub Profile
@jadenlemmon
jadenlemmon / gcp_idle_vm.sh
Created October 13, 2023 16:32
GCP Idle VM Shutdown Script
#!/bin/bash
# Add this script to instance metadata and reboot
# gcloud compute instances add-metadata INSTANCE_NAME --metadata-from-file startup-script=gcp_idle_vm.sh
# To follow logs sudo journalctl -f -u google-startup-scripts.service
# For this to work ensure your vm is private or has appropriate firewall rules
# otherwise brute force attacks will keep your vm alive
has_connection_existed=false
idle_count=0
@jadenlemmon
jadenlemmon / wolf-config-schema.yaml
Created April 25, 2023 19:21
wolf config schema
{
"$schema": "http://json-schema.org/draft-06/schema#",
"$ref": "#/definitions/Welcome6",
"definitions": {
"Welcome6": {
"type": "object",
"additionalProperties": false,
"properties": {
"k8s": {
"$ref": "#/definitions/K8S"
# Install NVM
# https://github.com/nvm-sh/nvm#install--update-script
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
# Install Docker
# https://docs.docker.com/engine/install/ubuntu/
sudo apt-get update -y && \
sudo apt-get install -y \
ca-certificates \
curl \
@jadenlemmon
jadenlemmon / Dockerfile
Created March 23, 2022 19:44
Island List Example Dockerfile
FROM voyageapp/node:17.6-alpine as node
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run css
FROM python:3.8-alpine
@jadenlemmon
jadenlemmon / app.py
Created March 23, 2022 19:40
Example Flask App
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello_world():
return "<p>Hello, World!</p>"
@jadenlemmon
jadenlemmon / config.yml
Created March 23, 2022 19:39
Island List Example Voyage Config
# .voyage/config.yml
services:
app:
context: ./
primary: true
exposePort: 5000
environment:
- name: APP_ENV
value: voyage
- name: DB_HOST
@jadenlemmon
jadenlemmon / docker-compose.yml
Created March 23, 2022 19:36
Island List Example Docker Compose File
version: "3"
services:
app:
build:
context: ./
environment:
APP_ENV: local
DB_HOST: database
networks:
- islandfinder
@jadenlemmon
jadenlemmon / tailwind.config.js
Created March 23, 2022 19:30
Example Tailwind Config File
module.exports = {
content: ["./lib/templates/**/*.{html,j2}"],
theme: {
extend: {},
},
plugins: [require("@tailwindcss/forms")],
};
@jadenlemmon
jadenlemmon / .gitconfig
Last active November 4, 2021 14:30
Git alias config file
[alias]
branch-name = "!git rev-parse --abbrev-ref HEAD"
c = checkout
cb = checkout -b
s = status
# push the current branch
pub = "!git push -u origin $(git branch-name)"
# open a pr in github
open = "!f() { open \"$(git ls-remote --get-url $(git config --get branch.$(git branch --show-current).remote) | sed 's|[email protected]:\\(.*\\)$|https://github.com/\\1|' | sed 's|\\.git$||')/compare/$(git config --get branch.$(git branch --show-current).merge | cut -d / -f 3-)?expand=1\"; }; f"
last = log -1 HEAD --stat
@jadenlemmon
jadenlemmon / index.js
Created November 1, 2021 17:55
Example A/B Test Gatsby v4 SSR Cookies
import { sample } from 'lodash';
import React from 'react';
import cookie from 'cookie';
import Layout from '../components/layout';
import HomeV1 from '../components/scenes/home/v1';
import HomeV2 from '../components/scenes/home/v2';
const EXPERIMENT_OPTIONS = {
v1: HomeV1,
v2: HomeV2,