Skip to content

Instantly share code, notes, and snippets.

@stevenferrer
stevenferrer / System Design.md
Created August 31, 2024 12:27 — forked from vasanthk/System Design.md
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?
@stevenferrer
stevenferrer / linux_wifi_setup.md
Created May 11, 2024 13:53 — forked from bespokoid/linux_wifi_setup.md
Connecting to wifi network through command line #linux #cmd

Connecting to wifi network through command line

I am trying to connect to my WEP network just using the command-line (Linux).

I run:

sudo iwconfig wlan0 mode Managed essid 'my_network' key 'xx:xx:... hex key, 26 digits'

Then I try to obtain an IP with

@stevenferrer
stevenferrer / gomock.md
Created March 2, 2023 06:09 — forked from thiagozs/gomock.md
Tutorial gomock

08/16/17 by  Sergey Grebenshchikov

No Comments

This is a quick tutorial on how to test code using the GoMock mocking library and the standard library testing package testing.

GoMock is a mock framework for Go. It enjoys a somewhat official status as part of the github.com/golang organization, integrates well with the built-in testing package, and provides a flexible expectation API.

@stevenferrer
stevenferrer / interactive_circle_transformation.py
Created May 16, 2022 08:12
Interactive circle transformation via matrix multiplication
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider
fig, ax = plt.subplots()
fig.tight_layout()
ax.set_aspect('equal', adjustable='box')
ax.set_frame_on(False)
@stevenferrer
stevenferrer / main_1.go
Created May 5, 2022 10:22 — forked from pseudomuto/main_1.go
Blog Code: Clean SQL Transactions in Golang
package main
import (
"database/sql"
"log"
)
func main() {
db, err := sql.Open("VENDOR_HERE", "YOUR_DSN_HERE")
handleError(err)
@stevenferrer
stevenferrer / router.go
Created November 19, 2021 14:58 — forked from Hunsin/router.go
The package wraps julienschmidt's httprouter, making it support functions such as middlewares, sub/group routing with same prefix. Written in Go (Golang).
package router
import (
"context"
"net/http"
gpath "path"
"github.com/julienschmidt/httprouter"
)
/* Scrollbar */
/* From Quassel Wiki: http://sprunge.us/iZGB */
QScrollBar {
background: #131313;
margin: 0;
}
QScrollBar:hover {
/* Optional: Subtle accent of scrolling area on hover */
background: #161616; /* base +2 */
}
#!/bin/bash
python ./src/app.py
@stevenferrer
stevenferrer / http-proxy.go
Created September 18, 2019 06:33 — forked from fabrizioc1/http-proxy.go
Http proxy server in Go
package main
import (
"fmt"
"io"
"log"
"net/http"
)
type HttpConnection struct {