This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# check curl exists | |
if ! command -v curl >/dev/null 2>&1 | |
then | |
sudo apt install -y curl | |
fi | |
# check pup exists | |
if ! command -v pup >/dev/null 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package decoder | |
import ( | |
"encoding/json" | |
"io" | |
"net/http" | |
"github.com/gorilla/schema" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package workerpool | |
type Work[T any] func(workerID int, result chan<- T) error | |
type Pool[T any] interface { | |
Add(w Work[T]) | |
Shutdown() | |
Result() <-chan T | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
type Setter[V any] interface { | |
Set(value V) | |
} | |
type Getter[V any] interface { | |
Get() V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage: | |
// | |
// SomeFn(1, "test", WithArg1("optional 1"), WithArg2(true)) | |
// | |
package some_pkg | |
type Option func(*option) | |
type option struct { | |
arg1 string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package repository | |
import ( | |
"fmt" | |
"strings" | |
) | |
type Row interface { | |
SetPos(pos int) | |
Values() []any |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package http | |
import ( | |
"context" | |
"encoding/json" | |
"mime/multipart" | |
"net/http" | |
"github.com/go-chi/chi/v5" | |
"github.com/google/uuid" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with import <nixpkgs> {}; rec { | |
helloNixEnv = stdenv.mkDerivation { | |
name = "hello-nix-env"; | |
buildInputs = [ go ]; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ternary | |
type operatorIf[T comparable] struct { | |
condition bool | |
value T | |
elseIf *operatorIf[T] | |
elseValue T | |
} | |
func If[T comparable](condition bool) *operatorIf[T] { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Nerd Fonts for your IDE | |
# https://www.nerdfonts.com/font-downloads | |
brew tap homebrew/cask-fonts && brew install --cask font-3270-nerd-font | |
brew tap homebrew/cask-fonts && brew install --cask font-fira-mono-nerd-font | |
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-go-nerd-font | |
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-lgc-nerd-font | |
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-nerd-font | |
brew tap homebrew/cask-fonts && brew install --cask font-monofur-nerd-font | |
brew tap homebrew/cask-fonts && brew install --cask font-overpass-nerd-font |
NewerOlder