Skip to content

Instantly share code, notes, and snippets.

View wolfeidau's full-sized avatar
🐺
Building data science projects

Mark Wolfe wolfeidau

🐺
Building data science projects
View GitHub Profile
@wolfeidau
wolfeidau / Muffins.md
Last active August 2, 2021 11:40
This is my customised muffin recipe
@wolfeidau
wolfeidau / main.go
Created July 19, 2021 05:21
Simple app which copies files to S3 with content type and modtime
package main
import (
"context"
"fmt"
"io/fs"
"mime"
"os"
"path/filepath"
"time"
@wolfeidau
wolfeidau / Dockerfile
Last active December 29, 2022 22:32
Example multi-stage build container used with lambda docker support
#
# Based on https://docs.docker.com/develop/develop-images/multistage-build/
#
FROM public.ecr.aws/amazonlinux/amazonlinux:latest AS builder
WORKDIR /src
RUN yum install go -y
RUN yum install make -y
ADD . /src
---
AWSTemplateFormatVersion: '2010-09-09'
Description: >-
wolfeidau: Cloudformation deployment bucket used to host Serverless Application Model (SAM) artifacts and publish to Serverless Application Repository (SAR)
Parameters:
Stage:
Type: String
Description: The stage where the application is running in, e.g., dev, prod.
Default: "dev"
@wolfeidau
wolfeidau / template.yaml
Created January 26, 2021 22:43
template.yaml created by the sam CLI when you select create new project with docker + lambda
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
python3.8
Sample SAM Template for wolfe-python-app
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
@wolfeidau
wolfeidau / embed.go
Created December 20, 2020 21:03
Golang embed with echo and tests
package server
import (
"embed"
"net/http"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
)
@wolfeidau
wolfeidau / git.md
Created November 13, 2020 04:24
Git user switching

I found this user management strategy somewhere, and it's been working great for me:

git config --global --unset user.name
git config --global --unset user.email
git config --global --unset user.signingkey

git config --global user.useConfigOnly true

git config --global user..name ""
@wolfeidau
wolfeidau / main.go
Created October 11, 2020 12:21
Example program which creates a secure S3 bucket using the v2 Go SDK for AWS
package main
import (
"context"
"fmt"
"log"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/s3"
@wolfeidau
wolfeidau / .gitconfig
Last active August 11, 2020 03:15
Git aliases I currently use
[alias]
amend = !git add -A && git commit --amend --no-edit
p = !git push origin $(git rev-parse --abbrev-ref HEAD)
c = "!git add -A && git commit -m "
cc = "!git commit --amend -m "
co = !git checkout
f = !git fetch --all && git rebase origin/master
authors = shortlog --summary --email --numbered
l = log --graph --pretty=format:'%Cred%h%Creset -%C(green)%d%Creset %s %C(yellow)(%cr) %C(blue)<%an>%Creset'
[core]
@wolfeidau
wolfeidau / openid.yaml
Last active July 2, 2020 01:56
openid JSON openapi specification
openapi: 3.0.2
info:
title: OTK Server APIs
version: 4.3.1
description: "All API's available in OAuth Toolkit server"
paths:
/auth/oauth/v2/authorize:
get:
tags:
- Authorization Server APIs