Skip to content

Instantly share code, notes, and snippets.

View RichardKnop's full-sized avatar
🎯
Focusing

Richard Knop RichardKnop

🎯
Focusing
View GitHub Profile
@RichardKnop
RichardKnop / query_planner.markdown
Created February 27, 2021 21:24 — forked from hgmnz/query_planner.markdown
PostgreSQL query plan and SQL performance notes

Types of index scans

Indexes

Sequential Scan:

  • Read every row in the table
  • No reading of index. Reading from indexes is also expensive.
@RichardKnop
RichardKnop / merge_sort.go
Last active February 24, 2019 19:20
Merge Sort
package main
import (
"fmt"
)
func main() {
items := []int{4, 202, 3, 9, 6, 5, 1, 43, 506, 2, 0, 8, 7, 100, 25, 4, 5, 97, 1000, 27}
sortedItems := mergeSort(items)
fmt.Println(sortedItems)
@RichardKnop
RichardKnop / comb_sort.go
Last active July 12, 2017 03:42
Comb Sort
package main
import (
"fmt"
)
func main() {
items := []int{4, 202, 3, 9, 6, 5, 1, 43, 506, 2, 0, 8, 7, 100, 25, 4, 5, 97, 1000, 27}
combsort(items)
fmt.Println(items)
package main
import (
"fmt"
)
func main() {
items := []int{4, 202, 3, 9, 6, 5, 1, 43, 506, 2, 0, 8, 7, 100, 25, 4, 5, 97, 1000, 27}
shellshort(items)
fmt.Println(items)
@RichardKnop
RichardKnop / insertion_sort.go
Last active July 12, 2017 03:29
Insertion Sort
package main
import (
"fmt"
)
func main() {
items := []int{4, 202, 3, 9, 6, 5, 1, 43, 506, 2, 0, 8, 7, 100, 25, 4, 5, 97, 1000, 27}
insertionSort(items)
fmt.Println(items)
@RichardKnop
RichardKnop / selection_sort.go
Last active July 12, 2017 03:29
Selection Sort
package main
import (
"fmt"
)
func main() {
items := []int{4, 202, 3, 9, 6, 5, 1, 43, 506, 2, 0, 8, 7, 100, 25, 4, 5, 97, 1000, 27}
selectionSort(items)
fmt.Println(items)
@RichardKnop
RichardKnop / bubble_sort.go
Last active July 12, 2017 03:39
Bubble Sort
package main
import (
"fmt"
)
func main() {
items := []int{4, 202, 3, 9, 6, 5, 1, 43, 506, 2, 0, 8, 7, 100, 25, 4, 5, 97, 1000, 27}
bubbleSort(items)
fmt.Println(items)
@RichardKnop
RichardKnop / machinery.go
Created June 26, 2017 14:12
Machinery example: group of 100 tasks
package main
import (
"fmt"
"os"
"time"
"github.com/RichardKnop/machinery/v1"
"github.com/RichardKnop/machinery/v1/config"
"github.com/RichardKnop/machinery/v1/log"
@RichardKnop
RichardKnop / golang-tls.md
Created May 26, 2017 13:31 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would