Skip to content

Instantly share code, notes, and snippets.

Michel Luiz Milezzi michelmilezzi

Block or report user

Report or block michelmilezzi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@svett
svett / compress.go
Last active Sep 26, 2019
ZIP archives in Golang
View compress.go
import (
"archive/zip"
"io"
"os"
"path/filepath"
"strings"
)
func zipit(source, target string) error {
zipfile, err := os.Create(target)
@fphilipe
fphilipe / exclude.sql
Last active Sep 19, 2019
PostgreSQL EXCLUDE constraint
View exclude.sql
CREATE EXTENSION btree_gist;
CREATE TABLE room_reservations (
room_id integer,
reserved_at timestamptz,
reserved_until timestamptz,
canceled boolean DEFAULT false,
EXCLUDE USING gist (
room_id WITH =, tstzrange(reserved_at, reserved_until) WITH &&
) WHERE (not canceled)
@staltz
staltz / introrx.md
Last active Nov 19, 2019
The introduction to Reactive Programming you've been missing
View introrx.md
@soheilhy
soheilhy / nginxproxy.md
Last active Nov 19, 2019
How to proxy web apps using nginx?
View nginxproxy.md

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 example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

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

@hgmnz
hgmnz / query_planner.markdown
Created Mar 23, 2011
PostgreSQL query plan and SQL performance notes
View query_planner.markdown

Types of index scans

Indexes

Sequential Scan:

  • Read every row in the table
  • No reading of index. Reading from indexes is also expensive.
You can’t perform that action at this time.