Skip to content

Instantly share code, notes, and snippets.

@miguelgrinberg
miguelgrinberg / .vimrc
Last active November 19, 2025 18:07
My .vimrc configuration for working in Python with vim
" plugins
let need_to_install_plugins = 0
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
let need_to_install_plugins = 1
endif
call plug#begin()
Plug 'tpope/vim-sensible'
@jamesbar2
jamesbar2 / postal-codes.json
Last active November 24, 2025 17:40 — forked from matthewbednarski/postal-codes.json
Global postal codes regex formats
[{
"Note": "The first two digits (ranging from 10–43) correspond to the province, while the last two digits correspond either to the city/delivery zone (range 01–50) or to the district/delivery zone (range 51–99). Afghanistan Postal code lookup",
"Country": "Afghanistan",
"ISO": "AF",
"Format": "NNNN",
"Regex": "^\\d{4}$"
}, {
"Note": "With Finland, first two numbers are 22.",
"Country": "Åland Islands",
"ISO": "AX",
@dannguyen
dannguyen / ok-schools-mapzen-geocode.py
Created December 1, 2015 20:35
Geocoding Oklahoma schools with Mapzen
from csv import DictReader, DictWriter
from os import environ
from time import sleep
import requests
# http://www.ok.gov/sde/state-school-directory
FNAME = 'ok_directory_2015.csv'
ONAME = 'ok_directory_2015--geocoded.csv'
API_KEY = environ['MAPZEN_SEARCH_KEY']
BASE_URL = 'https://search.mapzen.com/v1/search'
OK_LAT = 35.470
@dannguyen
dannguyen / README.md
Last active November 20, 2017 14:52
Example of using Mapzen Search API with prioritization for geocoding
@rantav
rantav / README.md
Created August 23, 2012 06:13
Find slow queries in mongo DB

A few show tricks to find slow queries in mongodb

Enable profiling

First, you have to enable profiling

> db.setProfilingLevel(1)

Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...