Skip to content

Instantly share code, notes, and snippets.


Michel Luiz Milezzi michelmilezzi

View GitHub Profile
iamralch / compress.go
Last active September 14, 2022 02:23
ZIP archives in Golang
View compress.go
import (
func zipit(source, target string) error {
zipfile, err := os.Create(target)
fphilipe / exclude.sql
Last active January 5, 2023 17:34
PostgreSQL EXCLUDE constraint
View exclude.sql
CREATE TABLE room_reservations (
room_id integer,
reserved_at timestamptz,
reserved_until timestamptz,
canceled boolean DEFAULT false,
room_id WITH =, tstzrange(reserved_at, reserved_until) WITH &&
) WHERE (not canceled)
staltz /
Last active February 7, 2023 12:08
The introduction to Reactive Programming you've been missing
soheilhy /
Last active February 3, 2023 02:21
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for,, and on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

hgmnz / query_planner.markdown
Created March 23, 2011 14:14
PostgreSQL query plan and SQL performance notes
View query_planner.markdown

Types of index scans


Sequential Scan:

  • Read every row in the table
  • No reading of index. Reading from indexes is also expensive.