Skip to content

Instantly share code, notes, and snippets.

View psteinroe's full-sized avatar
👋

Philipp Steinrötter psteinroe

👋
View GitHub Profile
@psteinroe
psteinroe / supabase_api_auth.sql
Created December 13, 2022 10:03 — forked from FelixZY/supabase_api_auth.sql
How to configure Supabase (https://supabase.com/) to generate and accept API tokens.
-- Token Based API Access for Supabase
--
-- How to configure Supabase (https://supabase.com/) to generate and accept API tokens.
--
-- (c) 2022 Felix Zedén Yverås
-- Provided under the MIT license (https://spdx.org/licenses/MIT.html)
--
-- Disclaimer: This file is formatted using pg_format. I'm not happy with the result but
-- prefer to follow a tool over going by personal taste.
--
@psteinroe
psteinroe / trigger.sql
Created September 2, 2022 09:19
Example for using pg_net with triggers
create or replace function delete_external_provider()
returns trigger
language plpgsql
security invoker
as
$$
declare
v_api_base_url text;
v_delete_provider_api_url text;
v_provider provider := old;
{
"meta":{
"theme":"caffeine"
},
"basics":{
"name":"Philipp Steinrötter",
"label":"Full Stack Developer and Entrepreneur",
"image":"https://avatars.githubusercontent.com/u/19429600?v=4",
"summary":"Into building great products, startups and open source.",
"email":"philipp@steinroetter.com",
@psteinroe
psteinroe / nested-relay-pagination.ts
Last active September 15, 2021 07:41
nested relay pagination
import { stringifyVariables } from '@urql/core';
import {
Cache,
Resolver,
Variables,
NullArray,
} from '@urql/exchange-graphcache';
export type MergeMode = 'outwards' | 'inwards';
@psteinroe
psteinroe / Dockerfile
Last active June 20, 2022 02:01
cd.yaml
FROM node:fermium-alpine AS builder
WORKDIR /app/builder
COPY . .
# https://github.com/nodejs/docker-node/issues/384#issuecomment-305208112
RUN apk --no-cache add --virtual native-deps \
git g++ gcc libgcc libstdc++ linux-headers make python && \
yarn global add --silent node-gyp &&\
yarn --silent && \
apk del native-deps
@psteinroe
psteinroe / error.log
Created May 7, 2021 06:35
tf panic error
Terraform v0.15.2
on linux_amd64
Configuring remote state backend...
Initializing Terraform configuration...
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
@psteinroe
psteinroe / parse-olm.py
Last active December 20, 2023 19:39
Convert olm to csv
import zipfile
from lxml import etree
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import pandas as pd
import datetime
def load_attachment(zip, name):
fh = zip.open(name)
@psteinroe
psteinroe / setup-macos.sh
Last active September 12, 2022 13:23
A litte script to setup a new mac
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
xcode-select --install
brew update
brew tap homebrew/cask
brew tap homebrew/cask-versions
export PATH="/opt/homebrew/bin:$PATH"
softwareupdate --install-rosetta
set vm_game 2 // I have no idea what this shit is
set vm_cgame 2 // Nope
set vm_ui 2 // Nada
set dedicated 1 // Dedicated server but not announced
set com_hunkmegs 128 // How much RAM for your server
set net_port 27960 // The network port
seta sv_hostname "ENR Teamevent" // name that appears in server list
seta g_motd "Welcome to the ENR Teamevent!" // message that appears when connecting
seta sv_maxclients 16 // max number of clients than can connect