Skip to content

Instantly share code, notes, and snippets.

View florianmartens's full-sized avatar
🏠
Working from home

florianmartens

🏠
Working from home
View GitHub Profile
@florianmartens
florianmartens / Sample swagger file
Created February 26, 2023 13:11
Sample swagger file to illustrate bug in oatyp
{
"openapi": "3.0.0",
"paths": {
"/": {
"get": {
"operationId": "health",
"parameters": [],
"responses": { "200": { "description": "" } }
}
},
@florianmartens
florianmartens / gist:3a9ffc4200cb9ad33f64445461fe5c70
Created May 14, 2022 16:58
Codebuild inline policy for ecr
{
"Statement": [
### BEGIN ADDING STATEMENT HERE ###
{
"Action": [
"ecr:BatchCheckLayerAvailability",
"ecr:CompleteLayerUpload",
"ecr:GetAuthorizationToken",
"ecr:InitiateLayerUpload",
"ecr:PutImage",
@florianmartens
florianmartens / buildspec.yml
Created May 14, 2022 16:42
Buildspec for EB environement on ECS
version: 0.2
phases:
pre_build:
commands:
- echo Deleting app module
- rm -rf apps/app
- echo Logging in to Amazon ECR and docker hub...
- echo "$DOCKER_PW" | docker login -u "$DOCKER_ID" --password-stdin
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com
build:
@florianmartens
florianmartens / publish-env-to-shell.config
Created May 14, 2022 16:36
Publish environment variables to shell in elastic beanstalk
commands:
setvars:
command: /opt/elasticbeanstalk/bin/get-config environment | jq -r 'to_entries | .[] | "export \(.key)=\"\(.value)\""' > /etc/profile.d/sh.local
import "./utils/env";
import { App } from "@slack/bolt";
import { utcToZonedTime } from "date-fns-tz";
// post messages the next time it's 3pm
const getNextTimestamp = () => {
let date = new Date();
if (date.getHours() > 14) {
date.setDate(date.getDate() + 1);
{"openapi":"3.0.0","paths":{"/auth/signin":{"post":{"operationId":"signIn","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginDto"}}}},"responses":{"201":{"description":""}},"tags":["Auth"]}},"/auth/google-auth":{"get":{"operationId":"googleSignIn","parameters":[],"responses":{"200":{"description":""}},"tags":["Auth"]}},"/auth/google-redirect":{"get":{"operationId":"googleRedirect","parameters":[],"responses":{"200":{"description":""}},"tags":["Auth"]}},"/auth/refresh":{"get":{"operationId":"refreshToken","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponseDto"}}}}},"tags":["Auth"],"security":[{"bearer":[]}]}},"/auth/confirm-email":{"get":{"operationId":"confirmEmailAddress","parameters":[{"name":"token","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/component
interface User {
name: string;
}
interface Props {
user: User
setUser: (user: User) => void;
}
const UserDisplay = (props: Props) => {
interface EmptySet {
foo: string;
bar: string;
faz: object;
// -> add an infinite number of requirements
// ...
// ...
}
type ReallyPermissiveType = {} | string | number | symbol | bigint | boolean | undefined | null;
interface SmallerType {
foo: string;
baz: string;
}
let obj: SmallerType;
const smaller = {
// included in our requirements
foo: "foo",
baz: "bar",
// infinite number of other properties