Skip to content

Instantly share code, notes, and snippets.

@Sleepingwell
Sleepingwell / gist:7445312
Last active February 11, 2021 04:23
Example of using geoalchemy.
# A simple script to load data from a shapefile into a spatialite db.
# Transfering the geometries is slow. It would probably be much faster to
# use WKB directly for the load, but I cannot get this to work.
# This is largely copied from
# https://github.com/geoalchemy/geoalchemy/blob/master/examples/spatialite.py
import os, osgeo.ogr
from sqlite3 import dbapi2 as sqlite
from sqlalchemy.orm import sessionmaker
from sqlalchemy import event, create_engine, MetaData
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active June 13, 2024 10:59
A badass list of frontend development resources I collected over time.
@jaseg
jaseg / gist:3334991
Created August 12, 2012 22:32
Password manager without a password manager

Prelude

Since password managers are big and complicated and I currently am pretty bored since I am sitting in a car for a few hours, here is a simple algorithm to generate resource-specific, unique passwords using a master password and no password database.

WARNING

As pointed out here: http://news.ycombinator.com/item?id=4374888 this method is broken.

Usage

@thruflo
thruflo / test_geography.py
Created November 28, 2011 22:59
Example using PostGIS Geography Type with GeoAlchemy.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import code
import logging
from datetime import datetime
from sqlalchemy import create_engine, event
from sqlalchemy import Column, Float, Integer, MetaData, UnicodeText