Skip to content

Instantly share code, notes, and snippets.

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

Cyan Tarek cyantarek

🏠
Working from home
View GitHub Profile
ngrok config add-authtoken 1RECtskEFZlx0tcQ8awS0MU07FB_4WJzqW5jXdmnvckwssKwA
[log]
level = debug
[rest]
port = 8000
[security]
service_key = "dummy-service-key"
[database]

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.

RANDOM?=$(shell bash -c 'echo $$RANDOM')
DOCKER_HOST?=public.ecr.aws/x2y3y7d0
VERSION?=$(shell git describe --tags --always)
TAG?=latest
# build
build: build-api build-proxy
build-api:
version: '3'
services:
api:
image: public.ecr.aws/x2y3y7d0/api:latest
restart: always
ports:
- "7000:7000"
proxy:
image: public.ecr.aws/x2y3y7d0/proxy:latest
@cyantarek
cyantarek / main.go
Created January 16, 2021 07:54 — forked from salihzain/main.go
Go code to get the name of the function that invoked the current function
package main
import (
"fmt"
"runtime"
)
// whoCalledMe is a function that returns the name, fileName, and lineNumber of the caller that called function X
// the code doesn't check for edge cases
func whoCalledMe() (callerName, callerFileName string, callerLineNumber int) {
#!/bin/sh
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose
@cyantarek
cyantarek / README.md
Created October 1, 2020 18:07 — forked from crgimenes/README.md
Example of pagination using PostgreSQL, Golang and SQLx

Configure environment variable

export DATABASE_URL=postgres://postgres@localhost/dbname?sslmode=disable 

Run in CLI

go run main.go -page 1
<html>
<head>
<meta charset="utf-8"/>
<script src="wasm_exec.js"></script>
<script>
const go = new Go();
WebAssembly.instantiateStreaming(fetch("main.wasm"), go.importObject).then(async (result) => {
await go.run(result.instance);
});