Skip to content

Instantly share code, notes, and snippets.

View vincentsarago's full-sized avatar

Vincent Sarago vincentsarago

View GitHub Profile
@rjha
rjha / nginx-503.conf
Created June 17, 2012 06:35
Nginx configuration for 503 custom maintenance page
server {
listen 80;
# default catch-all domain
server_name _ ;
error_page 503 @503 ;
#return 503 ;
root /var/www/htdocs/ ;
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@wsargent
wsargent / docker_cheat.md
Last active June 29, 2024 19:32
Docker cheat sheet
@clhenrick
clhenrick / README.md
Last active March 3, 2025 23:02
PostgreSQL & PostGIS cheatsheet (a work in progress)
@econandrew
econandrew / NominatimOnEC2.md
Last active July 12, 2024 15:45
Instructions for installing an OpenStreetMap Nominatim geocoder instance on Amazon Linux / EC2 (Dec 2014)

Installing Nominatim on Amazon Linux / EC2

  1. Introduction

The official instructions for installing Nominatim are complete, but brief in places, and several steps must be changed in the Amazon Linux environment (which is roughly CentOS / Redhat). The steps below are rough record of what I did to get it working, but I didn't keep perfect track so you shouldn't rely on them as a shell script. Just follow each step, make sure it worked, and hopefully you'll need to adapt very little (version numbers, for one thing). (I also skip in and out of root, but you can be more careful if you like.)

  1. Setting up the EC2 instance

@samuelestabrook
samuelestabrook / Qt_fix_QGIS.md
Last active August 29, 2015 14:24
Fix Qt for Homebrew QGIS install

Fix Qt for Homebrew QGIS install

Go to terminal and roll back the Qt installation through GitHub

$ brew uninstall qt
$ brew install https://raw.githubusercontent.com/Homebrew/homebrew/8dd3478131b232553f4c0cab197f8443a0a559a6/Library/Formula/qt.rb
create or replace function pointToTileFraction(float, float, integer) returns int[3] as $$
declare
lon ALIAS FOR $1;
lat ALIAS FOR $2;
z ALIAS FOR $3;
result int[];
BEGIN
result := array_append(result, floor(pow(2,z) * (lon / 360 + 0.5))::int);
result := array_append(result, floor(pow(2,z) * (0.5-0.25 *(log((1 + sin(lat*pi()/180))/(1 - sin(lat*pi()/180)))/pi())))::int);
@gene1wood
gene1wood / all_aws_lambda_modules_python.md
Last active January 28, 2025 09:47
AWS Lambda function to list all available Python modules for Python 2.7 3.6 and 3.7
#!/usr/bin/env zsh
# ./day.sh month_number morning_day evening_day zoom_level
# Strictly alpha: for example, does not know how to handle
# month edges or unscheduled missing images.
set -eu
year=$1
@wboykinm
wboykinm / falsehoods.md
Last active April 23, 2025 08:09
Falsehoods programmers believe about addresses - by Michael Tandy

Falsehoods programmers believe about addresses

This is an anchor-linked version of the excellent, amazing original opus magnum by Michael Tandy.

An address will start with, or at least include, a building number.

Counterexample: Royal Opera House, Covent Garden, London, WC2E 9DD, United Kingdom.

When there is a building number, it will be all-numeric.

Counterexample: 1A Egmont Road, Middlesbrough, TS4 2HT