Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View delameko's full-sized avatar

Matt Slater delameko

View GitHub Profile
@delameko
delameko / upgrade-postgres-9.5-to-9.6.md
Last active August 22, 2023 08:22 — forked from johanndt/upgrade-postgres-9.3-to-9.5.md
Upgrading PostgreSQL from 9.5 to 9.6 on Ubuntu 16.04

TL;DR

Install Postgres 9.6, and then:

sudo pg_dropcluster 9.6 main --stop
sudo pg_upgradecluster 9.5 main
sudo pg_dropcluster 9.5 main
@delameko
delameko / country_abbreviations.ex
Last active July 11, 2022 10:57
A list of country abbreviations, in Elixir syntax
country_abbreviations = [
%{name: "Afghanistan", alpha_2_code: "AF", alpha_3_code: "AFG", continent: "asia"},
%{name: "Aland Islands", alpha_2_code: "AX", alpha_3_code: "ALA", continent: "europe"},
%{name: "Albania", alpha_2_code: "AL", alpha_3_code: "ALB", continent: "europe"},
%{name: "Algeria", alpha_2_code: "DZ", alpha_3_code: "DZA", continent: "africa"},
%{name: "American Samoa", alpha_2_code: "AS", alpha_3_code: "ASM", continent: "australia_and_oceania"},
%{name: "Andorra", alpha_2_code: "AD", alpha_3_code: "AND", continent: "europe"},
%{name: "Angola", alpha_2_code: "AO", alpha_3_code: "AGO", continent: "africa"},
%{name: "Anguilla", alpha_2_code: "AI", alpha_3_code: "AIA", continent: "north_america"},
%{name: "Antarctica", alpha_2_code: "AQ", alpha_3_code: "ATA", continent: "antartica"},
@delameko
delameko / iso-3166-1_codes.ex
Created May 12, 2017 11:45
ISO 3166-1 (alpha 2) country codes, in an Elixir list
country_codes = [
%{ iso_3166_1: "AF", name: "Afghanistan" },
%{ iso_3166_1: "AX", name: "Aland Islands" },
%{ iso_3166_1: "AL", name: "Albania" },
%{ iso_3166_1: "DZ", name: "Algeria" },
%{ iso_3166_1: "AS", name: "American Samoa" },
%{ iso_3166_1: "AD", name: "Andorra" },
%{ iso_3166_1: "AO", name: "Angola" },
%{ iso_3166_1: "AI", name: "Anguilla" },
%{ iso_3166_1: "AQ", name: "Antarctica" },
@delameko
delameko / currency_codes.ex
Created December 29, 2020 14:17
A list of currency codes and a list of currency details, written in elixir syntax
currency_codes = [
"AED",
"AFN",
"ALL",
"AMD",
"ARS",
"AUD",
"AZN",
"BAM",
"BDT",
@delameko
delameko / iso-639-1_codes.ex
Created May 11, 2017 22:14
ISO 639-1 language codes in Elixir
iso_codes = [
%{ iso_639_1: "ab", name: "Abkhazian" },
%{ iso_639_1: "aa", name: "Afar" },
%{ iso_639_1: "af", name: "Afrikaans" },
%{ iso_639_1: "ak", name: "Akan" },
%{ iso_639_1: "sq", name: "Albanian" },
%{ iso_639_1: "am", name: "Amharic" },
%{ iso_639_1: "ar", name: "Arabic" },
%{ iso_639_1: "an", name: "Aragonese" },
%{ iso_639_1: "hy", name: "Armenian" },
@delameko
delameko / postgres.sh
Last active September 21, 2018 10:21
Postgres cheatsheet
# List users (with permissions)
\du
# List databases
\l
# List schemas, with privileges
\dn+
# List table privileges
@delameko
delameko / cheatsheet.sh
Last active September 20, 2018 10:49
Shell command cheatsheet
#############
# Processes #
#############
# Finding a running process
ps aux | grep <processname>
pgrep <processname>
# Killing processes
#
@delameko
delameko / gist:184e4d3a4971a17314443afa0a4df0bd
Created July 13, 2016 17:21 — forked from koudelka/gist:f4d07b9d998d723e55a0
Possible http status codes module for Elixir Phoenix Web Framework
#
# Would this be useful to Phoenix?
#
# In controllers, it'd be nice to be able to refer to status codes as atoms instead of integers.
#
defmodule Phoenix.Controller.StatusCodes do
@http_status_codes %{
@delameko
delameko / screen-resolutions.md
Last active January 28, 2016 20:52
Popular screen resolutions

#Most Popular Screen Resolutions

##Apple

Resolution Device
320×480 iPhone 3GS
640×960 iPhone 4S
1024×768 iPad 1/2/Mini
1024×768+ Desktops/Laptops
@delameko
delameko / server-setup.md
Last active December 16, 2015 22:55
Setting up a new Ubuntu 14.04 server

Log in as root

ssh root@123.45.67.890

Change root password

passwd

Create new user