This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "fmt" | |
| func reverse(arr []interface{}) interface{} { | |
| var i = 0 | |
| var j = len(arr) - 1 | |
| for i < j { | |
| tmp := arr[i] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| func main() { | |
| fmt.Println("hello from the router") | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct CArea | |
| { | |
| int x; | |
| int y; | |
| } CArea; | |
| double area(struct CArea area_samp) | |
| { | |
| return 0.5 * area_samp.x * area_samp.y; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module "gke" { | |
| source = "terraform-google-modules/kubernetes-engine/google" | |
| project_id = "<PROJECT ID>" | |
| name = "gke-test-1" | |
| region = "us-central1" | |
| zones = ["us-central1-a", "us-central1-b", "us-central1-f"] | |
| network = "vpc-01" | |
| subnetwork = "us-central1-01" | |
| ip_range_pods = "us-central1-01-gke-01-pods" | |
| ip_range_services = "us-central1-01-gke-01-services" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "sync" | |
| ) | |
| var ( | |
| mutex = sync.Mutex{} | |
| balance int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| image: shemul/gitlab-ci | |
| variables: | |
| DOCKER_TLS_CERTDIR: "" | |
| stages: | |
| - test | |
| services: | |
| - name: docker:dind | |
| alias: dlocal | |
| test: | |
| stage: test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ubuntu:18.04 | |
| MAINTAINER Kief H. Shemul <[email protected]> | |
| # Update and upgrade repo | |
| RUN apt-get update -y -q && apt-get upgrade -y -q | |
| # Install tools we might need | |
| RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y -q curl build-essential ca-certificates git docker.io | |
| RUN curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose | |
| RUN chmod +x /usr/local/bin/docker-compose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package tasks | |
| import ( | |
| "encoding/base64" | |
| "encoding/json" | |
| "log" | |
| "net/smtp" | |
| ) | |
| type Payload struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package worker | |
| import ( | |
| "github.com/RichardKnop/machinery/v1" | |
| ) | |
| func StartWorker(taskserver *machinery.Server) error { | |
| worker := taskserver.NewWorker("machinery_worker", 10) | |
| if err := worker.Launch(); err != nil { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package server | |
| import ( | |
| base64 "encoding/base64" | |
| "encoding/json" | |
| "github.com/RichardKnop/machinery/v1" | |
| "github.com/RichardKnop/machinery/v1/tasks" | |
| "github.com/gofiber/fiber" | |
| "github.com/shemul/go-machinery/utils" | |
| task "github.com/shemul/go-machinery/tasks" |
NewerOlder