Skip to content

Instantly share code, notes, and snippets.

View upstarter's full-sized avatar
🎓
Goals, Options, Constraints, Decisions

Eric Steen upstarter

🎓
Goals, Options, Constraints, Decisions
View GitHub Profile
@todd-dsm
todd-dsm / auto-deploy-values.yaml
Last active November 6, 2024 00:04
example gitlab auto devops config with annotations for vault, datadog, etc
# This is a fully-formed GitLab Pipeline using Auto DevOps:
# Location: root of the code repo: .gitlab/auto-deploy-values.yaml
# https://docs.gitlab.com/ee/topics/autodevops/#features
name: my-service
replicaCount: 3
strategyType:
enableSelector:
deploymentApiVersion: apps/v1
image:
repository: gitlab.com/myGroup/myProject/my-service
@EdisonChendi
EdisonChendi / oneline_quicksort.py
Last active April 19, 2021 20:50
toy quick sort in python, just one line!
# -*- coding: UTF-8 -*-
quicksort = lambda l: quicksort([i for i in l[1:] if i < l[0]]) + [l[0]] + quicksort([j for j in l[1:] if j >= l[0]]) if l else []
## but readability counts
# def quicksort(l):
# if not l: return []
# pivot = l.pop()
# less = [i for i in l if i < pivot]
# greater = [j for j in l if j >= pivot]
@vielhuber
vielhuber / script.sh
Last active June 24, 2025 10:24
PostgreSQL: Backup and restore export import pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@vasanthk
vasanthk / System Design.md
Last active July 10, 2025 19:57
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@mikaelbr
mikaelbr / destructuring.js
Last active February 20, 2025 13:00
Complete collection of JavaScript destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
defmodule Bench do
@sample 1000
defp average(time) do
time / @sample
end
defp bench(fun) do
f = fn ->
Enum.each 1..@sample, fn _ -> fun.() end