Skip to content

Instantly share code, notes, and snippets.

View juliankoehn's full-sized avatar
:octocat:
I may be slow to respond.

Julian Köhn juliankoehn

:octocat:
I may be slow to respond.
View GitHub Profile
syntax = "proto3";
package entpb;
import "options/opts.proto";
import "google/protobuf/timestamp.proto";
option go_package = "github.com/yourorg/project/ent/proto/entpb";
message User {
@juliankoehn
juliankoehn / env.go
Created October 30, 2020 13:56
Medium GoCademy Tutorial: Packages
package env
import (
"bufio"
"errors"
"fmt"
"io"
"os"
"regexp"
"strings"
import boto3
import datetime
# Amazon Cognito User Pool Configs
LIMIT = 60
REGION = 'us-east-1'
USER_POOL_ID = 'us-east-1_aaaaaaaaa'
# Create boto3 CognitoIdentityProvider client
client = boto3.client('cognito-idp', REGION)
@juliankoehn
juliankoehn / prisma-go-idea.go
Created June 17, 2020 11:31
ideas for the prisma go client
package prisma
type EntityQuery struct {
QueryInterface
}
// implementing into model struct
// not as INTERFACE, to use inheritance.
// we can still customize funcs if needed
bringFocusInsideOverlay() {
return requestAnimationFrame(() => {
// Container ref may be undefined between component mounting and Portal rendering
// activeElement may be undefined in some rare cases in IE
if (
this.$refs.container == null ||
document.activeElement == null ||
!this.isShown
) {
return
@juliankoehn
juliankoehn / webgl.ts
Created April 6, 2020 12:00
[WIP] Image Processing
type FilterChain = {
func: Function
args: any[]
}
type FrameBuffer = {
fbo: WebGLFramebuffer | null
texture: WebGLTexture | null
}
@juliankoehn
juliankoehn / creditcard.go
Created March 25, 2020 16:06
Credit Card structs for stripe.com
// Creditcard a creditcard holds information
// about a card from StripeJS
// card brand
type Creditcard struct {
ID string `json:"id" db:"id"`
// Can be amex, diners, discover, jcb, mastercard, unionpay, visa, or unknown
Brand string `json:"brand" db:"brand"`
Checks Checks `json:"checks" has_one:"checks" fk_id:"credit_card_id"`
Country string `json:"country" db:"country"`
// Two-digit number representing the card’s expiration month.
@juliankoehn
juliankoehn / restcountries.eu
Last active September 6, 2019 18:06
all countries, currency, tld etc
[{
"name": "Afghanistan",
"topLevelDomain": [".af"],
"alpha2Code": "AF",
"alpha3Code": "AFG",
"callingCodes": ["93"],
"capital": "Kabul",
"altSpellings": ["AF", "Afġānistān"],
"region": "Asia",
"subregion": "Southern Asia",
@juliankoehn
juliankoehn / convertToUtf8.php
Created May 5, 2019 06:55
Simple UTF8 Converter Function (used for JTL -> Laravel (Latin1 to UTF8)
<?php
public function convertToUtf8 ($el) {
if (is_array($el)) {
foreach ($el as $key => $value) {
if (is_array($el[$key])) {
$el[$key] = $this->convertToUtf8($value);
} else {
$el[$key] = utf8_encode($value);
}
@juliankoehn
juliankoehn / nginx.conf
Created January 18, 2019 04:38 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048