Skip to content

Instantly share code, notes, and snippets.

View marc-barry's full-sized avatar

Marc Barry marc-barry

  • Ottawa ON, Canada
View GitHub Profile
@marc-barry
marc-barry / handler.js
Created June 30, 2020 18:29
Cloudflare Worker for Auth0 Self-Managed Certificates
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
const url = new URL(request.url)
url.hostname = 'SOME_HOSTNAME' // i.e. 'dev-w-47n-vy-cd-e88kLg26GFbLGgBI.edge.tenants.auth0.com'
request = new Request(request)
request.headers.set('cname-api-key', 'SOME_KEY') // i.e. 'd4f2f3ef5a3ee3af4846127281d3450628bdc16d63e802dea75878fe9a63a279'
FROM ruby:2.6.2-alpine3.9
ENV RAILS_VERSION 5.2.3
ENV SHIPIT_VERSION 0.27.1
# throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config --global frozen 1
RUN apk add --no-cache --virtual .build-deps \
build-base \
@marc-barry
marc-barry / Lua
Last active September 11, 2018 18:05
Marc's list of useful Lua stuff
# The programming language website
https://www.lua.org/
# Lua programming language information and resources
http://lua-users.org/wiki/
# Just-In-Time Compiler for Lua
http://luajit.org/
# Programming in Lua (first edition)
@marc-barry
marc-barry / OpenResty
Created September 11, 2018 17:47
Marc's list of useful OpenResty stuff
# A must read for the basic docs for the lua-nginx-module OpenResty module
https://github.com/openresty/lua-nginx-module#readme
# Nginx Development Kit - an Nginx module that adds additional generic tools that module developers can use in their own modules
https://github.com/simplresty/ngx_devel_kit
# Getting started guide
http://www.staticshin.com/programming/definitely-an-open-resty-guide/
# HTTP request processing phases in Nginx
@marc-barry
marc-barry / Go
Created July 31, 2018 16:45
Marc's list of useful Go stuff
# JSON-to-Go converter
https://mholt.github.io/json-to-go/
@marc-barry
marc-barry / Docker
Last active April 17, 2019 16:36
Marc's list of useful Docker stuff
# Run interactive TTY
$ docker run -it <image> /bin/sh
$ docker run -it <image> --entrypoint /bin/sh
# Publish a container’s port(s) to the host
$ docker run -p 127.0.0.1:80:80/tcp -it <image>
# Publish all exposed ports to random ports
$ docker run -P -it <image>