Skip to content

Instantly share code, notes, and snippets.

View arriqaaq's full-sized avatar
🎯
Focusing

Farhan arriqaaq

🎯
Focusing
View GitHub Profile
package main
type Repository interface {
Find(id int) (interface{}, error)
Save(data interface{}) error
}
type User struct {
ID int
Name string
@arriqaaq
arriqaaq / ns.sh
Created September 9, 2021 05:25
Network namespaces [Bridge + VETH]
#!/usr/bin/env bash
if [[ $EUID -ne 0 ]]; then
echo "You must be root to run this script"
exit 1
fi
BR_ADDR="10.10.0.1"
BR_DEV="br0"
---
IIP: 2
title: Data Retention in Immudb
author: Farhan Khan <farhan@codenotary.com>
status: Proposal
category: Storage
created: 2022-10-18
---
### Abstract
@arriqaaq
arriqaaq / truncaiton.md
Created February 13, 2023 03:46
Truncation Test Scenarios

Data Retention/Truncation Command Line Interface (CLI) Documentation

Introduction: The truncation command is an extention to the immuadmin CLI to perform data retention operations on a database. It supports parameters to specify the retention period and truncation frequency.

Usage: The CLI is invoked from the command line with the following syntax:

./immuadmin database create db [OPTIONS]
// Font is the flyweight object
type Font struct {
fontType string
fontSize int
fontColor string
}
// FontFactory is the flyweight factory
type FontFactory struct {
fonts map[string]*Font
package main
import (
"fmt"
"sync"
)
type Character struct {
Appearance string
Name string
package main
import (
"fmt"
"sync"
)
type RequestHandler struct {
sharedState string
}
package main
import (
"sync"
"time"
)
var objectPool = sync.Pool{
New: func() interface{} {
return time.Now()
package main
import (
"image"
"sync"
)
var imageCache = sync.Map{}
func getImage(path string) image.Image {
package main
import (
"database/sql"
"sync"
)
var connectionPool = sync.Pool{
New: func() interface{} {
db, _ := sql.Open("postgres", "user=postgres dbname=mydb sslmode=disable")