Skip to content

Instantly share code, notes, and snippets.

View taion809's full-sized avatar
:shipit:
what are statuses for?

Nicholas Johns taion809

:shipit:
what are statuses for?
View GitHub Profile
@taion809
taion809 / main.go
Created November 8, 2023 04:33
HTMX SSE K8S Demo
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"net/http"
"github.com/go-chi/chi"
@taion809
taion809 / ring.go
Created April 20, 2023 04:35
Simple ring buffer
package main
import (
"fmt"
"strings"
)
type Ring struct {
buffer []string
size int
@taion809
taion809 / ofms.md
Created April 28, 2019 20:53
Observable F# Microservices

Observable FSharp Microservices (dotnetcore2.2+)

Let us define an observable microservice as one that exposes its internal state through events, metrics, and trace data. Ideally we can aggregate this data in some sort of centralized observability system for alerting and diagnostics. In my opinion there are tools that work much better than others and I will use those in this example but the most important part is that you have a starting point and your services can be observed and alerted on somehow. If your company does not have the means to setup all of this infrastructure you should consider buying one of the many SaaS options out today.

Disclaimer: I am not a native .net or F# developer, I think at this point in my career I've logged 2 weeks on an F# dev team so the implementations given below may not be idiomatic, however, my experience comes from being apart of both Devops and microservices dev teams in other teams and organizations.

That being said; let's start building an "observable" micro

@taion809
taion809 / d.fs
Created March 3, 2019 21:22
F# json.net deserialize
namespace PoeIngester
open HttpFs.Client
open System.Net.Http
open Hopac
open Newtonsoft.Json
module Bookmark =
type responseBody = {
[<JsonProperty(PropertyName="next_change_id")>]
NextChangeId: string;
load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library")
def envoy_package():
native.package(default_visibility = ["//visibility:public"])
# Compute the final copts based on various options.
def envoy_copts(repository, test = False):
return [
"-Wall",
"-Wextra",
Output the state of the DAG when a task executes (output to logs)
Save the version of your workflow and the task code you used (so you can check logs later and recreate data as needed)
script a way to prune the data from any point in the DAG that will also prune data downstream so you can rerun workflows.
log task ids, hadoop application ids, etc when the task executes.
package transceiver
import (
"context"
"strings"
"github.com/confluentinc/confluent-kafka-go/kafka"
)
type Tx interface {
@taion809
taion809 / udp_client.go
Created October 21, 2015 00:16 — forked from reterVision/udp_client.go
A dummy UDP hole punching sample in Go
package main
import (
"encoding/json"
"fmt"
"log"
"net"
"os"
"time"
)
@taion809
taion809 / thing.sh
Created August 11, 2015 23:01
No BS nodejs install
# fuck i hate using curl http://shitty-url.com/something.sh | sudo bash -
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
deb https://deb.nodesource.com/node_0.12 trusty main
deb-src https://deb.nodesource.com/node_0.12 trusty main
sudo apt-get update
sudo apt-get install nodejs
http://stackoverflow.com/questions/1057564/pretty-git-branch-graphs