Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#!/bin/bash | |
# based on https://lebkowski.name/docker-volumes/ | |
# remove exited containers: | |
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v | |
docker volume ls -qf dangling=true | xargs -r docker volume rm | |
# remove unused images: | |
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi |
# WARNING: This docker-compose.yml is only for testing purpose. | |
# Parameters: | |
# - name: CONFLUENT_PLATFORM_VERSION | |
# default: 3.0.0 | |
# reference: https://hub.docker.com/u/confluentinc/ | |
# Ports: | |
# - description: Major ports are exposed to host computer | |
# - zookeeper: 2181 | |
# kafka1: 9091 | |
# kafka2: 9092 |
parameter from request = page and limit | |
so, | |
offset = (page - 1) * limit | |
but you need to check if page <= 0 then page = 1 | |
if limit <= 0 then set it to default minimum limit | |
# Inspiration: https://b.agilob.net/test-coverage-in-gitlab-ci-in-a-golang-project | |
# Navigate to: "Settings" -> "CI/CD" -> "Expand" next to "General pipeline settings" | |
# 1. Add ^coverage:\s(\d+(?:\.\d+)?%) tas your regex in "Test coverage parsing" | |
# 2. Go to "Pipeline status" to get the badges code | |
# This file is a template, and might need editing before it works on your project. | |
image: golang:1.13.4-alpine | |
services: | |
- docker:stable-dind # only docker daemon, so we need to install docker cli and docker compose in separate script |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
package main | |
import ( | |
"bytes" | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/tls" | |
"crypto/x509" | |
"crypto/x509/pkix" | |
"encoding/pem" |
# run with: docker-compose -f postgres.yml up | |
# psql "postgres://postgres:postgres@localhost:5433" | |
version: '3.1' | |
services: | |
db: | |
image: postgres:12-alpine | |
restart: always | |
environment: |
package fsm | |
import ( | |
"encoding/json" | |
"fmt" | |
"github.com/dgraph-io/badger/v2" | |
"github.com/hashicorp/raft" | |
"io" | |
"os" | |
"strings" |
package store_handler | |
import ( | |
"encoding/json" | |
"fmt" | |
"github.com/hashicorp/raft" | |
"github.com/labstack/echo/v4" | |
"net/http" | |
"strings" | |
"time" |
# MY_IP=$(ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p') docker-compose up | |
# reference: | |
# https://github.com/jaegertracing/jaeger/blob/v1.21.0/docker-compose/jaeger-docker-compose.yml | |
# https://gist.github.com/bocharovf/e19fa80f7b5f6b65db17249c91e79416 | |
version: "3.5" | |
services: | |
agent1: | |
image: jaegertracing/jaeger-agent:1.21 | |
command: [ | |
# see https://www.jaegertracing.io/docs/1.21/deployment/#discovery-system-integration |