Skip to content

Instantly share code, notes, and snippets.

@dthtvwls
dthtvwls / .gitignore
Created April 18, 2025 13:47
Fully automated, GitOps-driven CI/CD pipeline to deploy a sample microservice application to an AWS EKS cluster.
# Local .terraform directories
**/.terraform/*
# .tfstate files
*.tfstate
*.tfstate.*
*.tfplan
# Crash log files
crash.log
import { useEffect, useState } from 'react'
import Navbar from 'react-bootstrap/Navbar'
import Secrets from './Secrets'
function App() {
const [namespaces, setNamespaces] = useState(["default"]);
const [namespace, setNamespace] = useState("default");
useEffect(() => (
@dthtvwls
dthtvwls / app.py
Created March 16, 2021 23:48
CORS proxy
from flask import Flask, request
from flask_cors import CORS
import requests
app = Flask(__name__)
CORS(app)
@app.route('/<path:path>')
def root(path):
@dthtvwls
dthtvwls / template-apply.go
Last active June 8, 2018 17:11
put a json structure on stdin, call `template-apply path/to/template`, receive executed template on stdout
package main
import (
"encoding/json"
"io/ioutil"
"os"
"text/template"
)
func check(err error) {
version: "3"
services:
kafka:
image: confluentinc/cp-kafka
depends_on:
- zookeeper
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
@dthtvwls
dthtvwls / server.go
Created May 15, 2018 19:49
Display departing trains from FiDi
package main
import (
"encoding/json"
"html/template"
"io/ioutil"
"net/http"
"sort"
"time"
)
@dthtvwls
dthtvwls / app.js
Last active February 24, 2018 04:47
crossfader shim backend with socket.io
const express = require('express')
const app = express()
const http = require('http')
const server = http.createServer(app)
const socket = require('socket.io')
const io = socket(server)
let config = {
servers: ['example.com', 'example.net'],
subtrahend: 0
@dthtvwls
dthtvwls / README.md
Last active August 3, 2017 19:17
rpc_engine
package main

import (
	"encoding/json"
	"fmt"
	"rpc_engine"
)

func main() {
@dthtvwls
dthtvwls / trie.go
Last active May 24, 2017 11:41
Search stems in the dictionary using a trie
package main
import (
"bufio"
"flag"
"io/ioutil"
"log"
"net"
"os"
"strconv"
@dthtvwls
dthtvwls / dict.go
Last active May 17, 2017 14:18
Ask if a word is in the dictionary via TCP
package main
import (
"bufio"
"flag"
"fmt"
"io/ioutil"
"log"
"net"
"os"