Skip to content

Instantly share code, notes, and snippets.

View alfranz's full-sized avatar
🥥

Alex Franz alfranz

🥥
View GitHub Profile
@alfranz
alfranz / Makefile
Last active March 5, 2021 14:36
Self-documenting Makefile for web projects - inspired by https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
start: ## Start the docker containers
@echo "Starting the docker containers"
@docker-compose up -d
@echo "Containers started - http://localhost:8000"
stop: ## Stop Containers
@docker-compose down
build: ## Build Containers
@docker-compose build
@alfranz
alfranz / countriesAddressPostal.js
Created July 10, 2020 08:25 — forked from ShreyKumar/countriesAddressPostal.js
List of countries and their respective postal codes with ranges (July 2020)
// Country list source: https://www.dhl.com/en/country_profile.html#.XwODEJNKjOQ
// Country abbreviation source: https://planetarynames.wr.usgs.gov/Abbreviations
// Postal code: https://gist.githubusercontent.com/jamesbar2/1c677c22df8f21e869cca7e439fc3f5b/raw/21662445653ac861f8ab81caa8cfaee3185aed15/postal-codes.json
// Postal code: https://en.wikipedia.org/wiki/List_of_postal_codes
// Country/territory items with no postal code regexes or ranges either do not require postal codes
// or there may not be enough information for that country/territory
export const COUNTRY_ADDRESS_POSTALS = [{
abbrev: 'AF',
@alfranz
alfranz / countries_codes_and_coordinates.csv
Created July 9, 2020 12:22 — forked from tadast/countries_codes_and_coordinates.csv
Countries with their (ISO 3166-1) Alpha-2 code, Alpha-3 code, UN M49, average latitude and longitude
Country Alpha-2 code Alpha-3 code Numeric code Latitude (average) Longitude (average)
Afghanistan AF AFG 4 33 65
Albania AL ALB 8 41 20
Algeria DZ DZA 12 28 3
American Samoa AS ASM 16 -14.3333 -170
Andorra AD AND 20 42.5 1.6
Angola AO AGO 24 -12.5 18.5
Anguilla AI AIA 660 18.25 -63.1667
Antarctica AQ ATA 10 -90 0
Antigua and Barbuda AG ATG 28 17.05 -61.8
import numpy as np
import pandas as pd
df = pd.read_csv("some/path/foo.csv")
print(df.head)
@alfranz
alfranz / fizzbuzz
Created June 29, 2014 17:56
FizzBuzz in Python
# This is my first gist code snippet
# It's just the popular FizzBuzz function coded in Python
def fizzbuzz():
for i in range(101):
if (i%3==0) and (i%5==0):
print "FizzBuzz this is", i
elif i%3==0:
print "Fizz this is", i
elif i%5==0: