Skip to content

Instantly share code, notes, and snippets.

View evanshortiss's full-sized avatar
:octocat:
🇮🇪 🇺🇸

Evan Shortiss evanshortiss

:octocat:
🇮🇪 🇺🇸
View GitHub Profile
@evanshortiss
evanshortiss / knex.neon-http.ts
Created May 17, 2024 21:04
Using knex@3.x with Neon's HTTP Driver
import { Client, knex } from 'knex';
import { NeonQueryFunction, neon } from '@neondatabase/serverless';
class KnexNeonHTTP extends Client{
connection: NeonQueryFunction<false, false>;
constructor(config) {
super(config);
this.driverName = 'neon';
}
@evanshortiss
evanshortiss / policy.json
Last active May 7, 2021 19:51
Uber liberal AWS IAM Policy...DANGER ZONE
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "*",
"Resource": "*",
"Effect": "Allow"
}
]
}
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
labels:
build: webapp-nginx-runtime
name: webapp-nginx-runtime
namespace: node-s2i-nginx
spec:
failedBuildsHistoryLimit: 5
successfulBuildsHistoryLimit: 5
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
labels:
build: webapp-npm-build
name: webapp-npm-build
namespace: node-s2i-nginx
spec:
failedBuildsHistoryLimit: 5
successfulBuildsHistoryLimit: 5
# Note you must have golang installled and configured to do this!
# Login as a cluster admin
oc login $CLUSTER_URL
# install moq
# (make sure $GOPATH/bin/ is on your $PATH so moq can be found)
go get github.com/matryer/moq
# setup the operator repo
{
"openapi": "3.0.2",
"info": {
"title": "orders-internal",
"description": "This is an internal API that exposes order entries contained in the system.",
"version": "1.0.0"
},
"paths": {
"/orders": {
"description": "Used to interact with orders stored in the backing data store.",
---
openapi: 3.0.2
info:
title: orders-internal
version: 1.0.0
description: This is an internal API that exposes order entries contained in the
system.
paths:
/orders:
description: Used to interact with orders stored in the backing data store.
@evanshortiss
evanshortiss / mqtt.service.yml
Last active July 16, 2019 16:33
#2- create MQTT service for AeroGear Showcase deployed using the aerogear/mobile-services-installer setup script
apiVersion: v1
kind: Service
metadata:
annotations:
openshift.io/generated-by: OpenShiftNewApp
creationTimestamp: null
labels:
app: sync-app-showcase-server
name: mosquitto-mqtt-broker
spec:
@evanshortiss
evanshortiss / mqtt.dc.yml
Created July 11, 2019 23:03
#1 - create MQTT deployment for AeroGear Showcase deployed using the aerogear/mobile-services-installer setup script
kind: DeploymentConfig
apiVersion: v1
name: mosquitto-mqtt-broker
metadata:
annotations:
openshift.io/generated-by: OpenShiftNewApp
creationTimestamp: null
labels:
app: sync-app-showcase-server
name: mosquitto-mqtt-broker
@evanshortiss
evanshortiss / without-env-var.example.js
Last active October 14, 2021 16:30
Example code running without env-var. This is how you might implement env.get(MAX_BATCH_SIZE).required().asIntPositive()
/**
* All the assertion code below the line could be replaced with
* this single line by using env-var
*/
env.get(MAX_BATCH_SIZE).required().asIntPositive()
// -----------------------------------------------
const assert = require('assert');