Skip to content

Instantly share code, notes, and snippets.

View normic's full-sized avatar
🎯
Focusing

Michael Heumann normic

🎯
Focusing
View GitHub Profile
@normic
normic / countries_codes_and_coordinates.csv
Created June 12, 2022 12:56 — forked from cpl/countries_codes_and_coordinates.csv
Countries with their (ISO 3166-1) Alpha-2 code, Alpha-3 code, UN M49, average latitude and longitude coordinates FROM https://gist.github.com/tadast/8827699, without duplicates
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
@normic
normic / change_db_owner.sh
Created September 23, 2020 16:46 — forked from gingerlime/change_db_owner.sh
Postgresql - Changing ownership on all tables
#!/bin/bash
usage()
{
cat << EOF
usage: $0 options
This script set ownership for all table, sequence and views for a given database
Credit: Based on http://stackoverflow.com/a/2686185/305019 by Alex Soto
@normic
normic / noscript-tracking.go
Created May 10, 2019 12:22 — forked from wybiral/noscript-tracking.go
Tracking cursor position in real-time with remote monitoring (without JavaScript)
// Tracking cursor position in real-time without JavaScript
// Demo: https://twitter.com/davywtf/status/1124146339259002881
package main
import (
"fmt"
"net/http"
"strings"
)
@normic
normic / forms.py
Created April 10, 2016 11:00 — forked from gonvaled/forms.py
Django widget to replace the file selection standard button by an image preview. Tested with Django 1.8.5
from django.forms import ModelForm, FileField
from .models import Campaign
from .widgets import ImagePreviewWidget
class DesignCampaignForm(ModelForm):
brand_logo = FileField(widget=ImagePreviewWidget)
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9