Skip to content

Instantly share code, notes, and snippets.

View chhetripradeep's full-sized avatar
🏠
Working from home

Pradeep Chhetri chhetripradeep

🏠
Working from home
View GitHub Profile
@ceberly
ceberly / Makefile
Last active November 13, 2023 17:31
Row vs. Column access patterns
default:
gcc -O0 -g3 -Wall -Wextra -Wconversion -Wdouble-promotion \
-Wno-unused-parameter -Wno-unused-function -Wno-sign-conversion \
main.c
format:
clang-format -i main.c
@richardartoul
richardartoul / goroutine_pool.go
Created July 24, 2023 14:15
A simple Goroutine pool for amortizing stack growth overhead
package pool
import (
"fmt"
"sync"
"runtime"
)
// GoroutinePool pools Goroutines to avoid performance penalties associated with spawning many
// short-lived goroutines that each have to individually grow their stack.
CREATE TABLE payment_types (
payment_type UInt8,
description String
)
ENGINE = MergeTree
ORDER BY payment_type;
INSERT INTO payment_types(payment_type, description) VALUES
(1, 'credit card'),
(2, 'cash'),
@HenningTimm
HenningTimm / rust_mem_profiling.md
Last active May 4, 2024 03:48
Memory profiling Rust code with heaptrack in 2019
@keyan
keyan / config_management_terms.md
Last active March 22, 2024 15:55
Chef <-> Salt <-> Puppet terminology equivalence

Recently I have had to deal with Salt configuration. I am doing product work so I didn't want to focus too much on deeply grasping Salt, but instead knowing the terminology equivalents to Chef/Puppet which I am comfortable with.

Salt Chef Puppet
state resource resource
states recipes manifests
formula* cookbook module
pillars databags hiera
grains ohai facter
[package]
name = "snake_game"
version = "0.1.0"
authors = ["youcodethings <spyr1014@gmail.com>"]
[dependencies]
piston = "0.36.0"
piston2d-graphics = "0.26.0"
pistoncore-glutin_window = "0.45.0"
piston2d-opengl_graphics = "0.52.0"
@enricofoltran
enricofoltran / main.go
Last active July 25, 2024 03:38
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@bobrik
bobrik / README.md
Last active May 7, 2024 12:19
CFS hiccups
# Convert resources.requests.memory into JVM heap sizes.
{{- define "memoryRequest" -}}{{ include "_memoryRequest" . | trim | trimSuffix "i" | lower }}{{- end -}}
{{- define "_memoryRequest" -}}
{{- $default := "256m" -}}
{{ if .Values.resources }}
{{ if (hasKey .Values.resources "requests") }}
{{ if (hasKey .Values.resources.requests "memory") }}
{{ .Values.resources.requests.memory }}
{{ else }}
# zookeeper connection string
{{- define "zookeepers" -}}{{ include "_zookeepers" . | trim | replace "\n\n" "," | nospace }}{{- end -}}
{{- define "_zookeepers" -}}
{{ $values := . }}
{{ range $i, $e := until (int .Values.zookeeper.replicaCount) }}
{{ template "zookeeperName" $values }}-{{ $i }}.{{ template "headlessZookeeper" $values }}
{{ end }}
{{- end -}}