Skip to content

Instantly share code, notes, and snippets.

View ahndmal's full-sized avatar
😔
stand with my homeland Ukraine

Andrii Maliuta ahndmal

😔
stand with my homeland Ukraine
View GitHub Profile
package main
import (
"encoding/json"
"net/http"
"path"
"strconv"
)
type Post struct {
import { createServer } from "http";
const server = createServer((req, res) => {
res.writeHead(200, { "Content-Type": "application/json" });
res.end(
JSON.stringify({
data: "Hello World!",
})
);
});
# GraphQL
# Type queries into this side of the screen, and you will
# see intelligent typeaheads aware of the current GraphQL type schema,
# live syntax, and validation errors highlighted within the text.
# We'll get you started with a simple query showing your username!
query {
user(login: "AndriiMaliuta") {
# fetch only owner repos & not forks
repositories(ownerAffiliations: OWNER, isFork: false, first: 100) {
location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: minimal-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
### INGRESS
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: http-ingress
spec:
rules:
- http:
paths:
- path: /
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-wildcard-host
spec:
rules:
- host: "andmal.cyou"
http:
paths:
- pathType: Prefix
apiVersion: v1
kind: Secret
metadata:
name: testsecret-tls
namespace: default
data:
tls.crt: base64 encoded cert
tls.key: base64 encoded key
type: kubernetes.io/tls
@ahndmal
ahndmal / docker-compose-micros3.yml
Last active December 1, 2021 10:52
3 spring boot apps as microservices
version: '3'
services:
micro1-db:
image: sb-micro-1:0.0.1
container_name: sb-micro-1
environment:
- DB_URL=
- R2_USERNAME=
- R2_PASSWORD=
networks:
#
# Create a custom JLink runtime
#
FROM adoptopenjdk:16 AS builder
RUN cd /usr/local && \
curl -O https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz && \
tar xfvz apache-maven-3.6.3-bin.tar.gz && \
rm apache-maven-3.6.3-bin.tar.gz
COPY . /root
RUN export PATH=$PATH:/usr/local/apache-maven-3.6.3/bin && \