Skip to content

Instantly share code, notes, and snippets.

View mrsimonemms's full-sized avatar
🐝
Tinkerin'

Simon Emms mrsimonemms

🐝
Tinkerin'
View GitHub Profile
@mrsimonemms
mrsimonemms / is.go
Created December 25, 2022 17:18
Golang Is function
package main
import (
"fmt"
"go/types"
)
func Is[T types.Type](v types.Type) bool {
_, ok := v.(T)
return ok
@mrsimonemms
mrsimonemms / instructions.md
Last active February 19, 2023 11:29
Simon Emms public GPG keys

2. Download and import the desired public key

gpg --import simonemms-public-key.asc

3. List the keys available

gpg --list-key
@mrsimonemms
mrsimonemms / gitpod-installer.sh
Last active January 29, 2022 16:52
Use Gitpod installer from Docker
#!/bin/bash
# Save this script to a `gitpod-installer` file, make it
# executable and save to your $PATH directory. Now you can
# use this as you would the normal Installer binary.
#
# To change the Installer version, apply a `GITPOD_INSTALLER_VERSION`
# environment variable (or change the default value).
set -euo pipefail
@mrsimonemms
mrsimonemms / ingress.yaml
Created December 17, 2021 08:24
Gitpod installer ingress example
# Replace $DOMAIN with your own domain
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: gitpod
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-passthrough: "true"
spec:
@mrsimonemms
mrsimonemms / gateway.config.yml
Created June 3, 2021 21:01
Express Gateway Example
http:
port: 9999
admin:
port: 9876
host: 0.0.0.0
apiEndpoints:
# see: http://www.express-gateway.io/docs/configuration/gateway.config.yml/apiEndpoints
api:
paths:
- /api/v1/apiary
@mrsimonemms
mrsimonemms / node.js
Created January 19, 2021 15:40
Getting OpenFaaS secrets
const { promises: fs } = require('fs');
/**
* Get Secret
*
* Get a secret
*
* @link https://docs.openfaas.com/reference/secrets/#use-the-secret-in-your-function
* @param {string} secretName
* @returns {Promise<string>}
2020/07/29 09:34:44 [DEBUG] azurerm_data_factory_dataset_delimited_text.example apply errored, but we're indicating that via the Error pointer rather than returning it: One of `http_server_location`, `blob_storage_location` must be specified to create a DataFactory Delimited Text Dataset
2020/07/29 09:34:44 [ERROR] <root>: eval: *terraform.EvalApplyPost, err: One of `http_server_location`, `blob_storage_location` must be specified to create a DataFactory Delimited Text Dataset
2020/07/29 09:34:44 [ERROR] <root>: eval: *terraform.EvalSequence, err: One of `http_server_location`, `blob_storage_location` must be specified to create a DataFactory Delimited Text Dataset
@mrsimonemms
mrsimonemms / Makefile
Created July 3, 2020 21:38
OpenApiary Makefile
CONTAINER_NAME ?= open-apiary
TAG ?= develop
IMAGE = registry.gitlab.com/mrsimonemms/open-apiary:${TAG}
destroy:
docker stop ${CONTAINER_NAME} || true
docker rm ${CONTAINER_NAME} || true
.PHONY: destroy
deploy:

Keybase proof

I hereby claim:

  • I am mrsimonemms on github.
  • I am mrsimonemms (https://keybase.io/mrsimonemms) on keybase.
  • I have a public key ASDWmVzBQL-wc2XXO0HEwvP2uCHQ2S-kfRgc_irSpRpsawo

To claim this, I am signing this object:

@mrsimonemms
mrsimonemms / app.js
Last active June 28, 2017 12:22
Socket IO
const io = require('socket.io-client');
const socket = io('http://example.com/room/name');
socket
.on('connect', (...args) => {
// Do something on connection
})
.on('event1', (...args) => {
// Do something when an event is received