Skip to content

Instantly share code, notes, and snippets.

View leonmwandiringa's full-sized avatar
💭
Never lose you inner child

Leon Mwandiringa leonmwandiringa

💭
Never lose you inner child
View GitHub Profile

Keybase proof

I hereby claim:

  • I am techadontech on github.
  • I am leontinashe (https://keybase.io/leontinashe) on keybase.
  • I have a public key ASBB4LnIEFs0qcsKotK9PxNaW0pA2V-tAC6QUer7MHyHjgo

To claim this, I am signing this object:

version: '2'
services:
mysql:
image: 'docker.io/bitnami/mysql:8.0-debian-10'
volumes:
- 'mysql_data:/bitnami/mysql'
environment:
- MYSQL_USER=bn_wordpress
- MYSQL_DATABASE=bitnami_wordpress
- ALLOW_EMPTY_PASSWORD=yes
ARG GO_VERSION=1.12
FROM golang:${GO_VERSION}-alpine AS builder
RUN apk update && apk add alpine-sdk git && rm -rf /var/cache/apk/*
RUN mkdir -p /api
WORKDIR /api
COPY . .
package handlers
import (
"github.com/gin-gonic/gin"
)
func IsApplicationWorking(c *gin.Context){
c.JSON(200, gin.H{
"error": nil,
"status": "sucess",
package main
import (
"github.com/gin-gonic/gin"
"github.com/goprovision/api/handlers"
)
func main() {
//setup gin framework
r := gin.New()
@leonmwandiringa
leonmwandiringa / docker-compose.yaml
Last active July 30, 2020 21:02
nginx docker-compose proxy
version: '3'
services:
reverse-proxy:
build:
context: ./nginx
container_name: reverse_proxy
restart: always
networks:
- proxy_network
depends_on:
@leonmwandiringa
leonmwandiringa / main.go
Created December 17, 2019 18:50 — forked from zjhiphop/main.go
mongo-go-driver Demo
package main
import (
"context"
"github.com/mongodb/mongo-go-driver/bson"
"github.com/mongodb/mongo-go-driver/bson/objectid"
"github.com/mongodb/mongo-go-driver/bson/primitive"
"github.com/mongodb/mongo-go-driver/mongo"
"log"
"time"
@leonmwandiringa
leonmwandiringa / command_exists.go
Created November 30, 2019 17:12 — forked from miguelmota/command_exists.go
Golang check if command exists
package main
import (
"log"
"os/exec"
)
func main() {
path, err := exec.LookPath("ls")
if err != nil {
@leonmwandiringa
leonmwandiringa / Mongo.go
Created November 3, 2019 18:50 — forked from p4tin/Mongo.go
Golang Mongo CRUD Example
package mongo
import (
"time"
"log"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
// Profile - is the memory representation of one user profile
@leonmwandiringa
leonmwandiringa / nginx.conf
Created October 22, 2019 09:15 — 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