Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"os"
"strconv"
)
// Language: Go
//
version: "3"
services:
billine:
build:
context: .
dockerfile: billine/Dockerfile
hostname: billine
restart: always
env_file:
FROM ruby:2.6.3 AS builder
RUN apt-get update -qqy && \
apt-get install -qqy --no-install-recommends \
build-essential \
unzip \
xvfb \
cmake \
g++ \
qt5-default \
@samacs
samacs / posts.json
Created May 29, 2019 23:39
JSON Sample
// 20190529183835
// https://jsonplaceholder.typicode.com/posts
[
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
"body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
},
@samacs
samacs / units.json
Created May 28, 2019 19:04
Units (JSON)
{
"units": [
{
"id": "dc5f57a0-7c4a-4fb1-9958-c8ca4be5f257",
"price": 27.5,
"name": "108",
"description": "Air Cooled, Heated, Light in Unit, Stacked Space, 3rd floor",
"width": 5,
"length": 5,
"height": 8,
@samacs
samacs / main.go
Created May 21, 2019 00:39
Sort solution
package main
import "fmt"
// Language: Go
//
// Running:
//
// Assuming `elements := []int{1, 2, 3, 4}`
//
@samacs
samacs / main.go
Last active May 20, 2019 23:54
Shortest path in grid
package main
import (
"fmt"
"math"
)
// Language: Go
//
// Running:
@samacs
samacs / main.go
Last active May 20, 2019 22:56
Reverse Factorization
package main
import (
"bufio"
"fmt"
"io"
"os"
"sort"
"strconv"
"strings"
@samacs
samacs / micro-api-gateway.md
Created April 1, 2019 22:47
Can’t reach services through API gateway

I have a gRPC server exposing three services:

// cmd/account/main.go
func main () {
	service := micro.NewService(
		micro.Name("io.coderoso.srv.v1.account"),
	)

	accountHandler := handler.NewAccountHandler()
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->