Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / leaflet_marker_fade_in_and_out.html
Created December 4, 2012 01:58
Fade in and fade out markers for Leaflet.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Marker Fade</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4.5/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4.5/leaflet.ie.css" />
@amandabee
amandabee / README.md
Created March 11, 2016 00:30
Philadelphia Bail Debt Scraper

One or the other of these is the scraper I used for the Philadelphia Court Debt project. I didn't realize until after I promised everyone in the room my code that I had never published it.

Not for nothing, I make no assertion that this is great programming or even remotely reflects best practices in python or scraping. There's plenty here that I would do differently if I did it again today.

I don't even know which of these was the final scraper. I could figure that out but then I'd never get around to throwing it online. So here it is, warts and all.

@JoeGermuska
JoeGermuska / cr-api-pandas.py
Last active April 25, 2016 15:49
Using Census Reporter API with Pandas
import pandas as pd
import requests
API_URL="http://api.censusreporter.org/1.0/data/show/{release}?table_ids={table_ids}&geo_ids={geoids}"
def get_data(tables=None, geoids=None, release='latest'):
if geoids is None:
geoids = ['040|01000US']
if tables is None:
tables = ['B01001']

This is my default career advice for people starting out in geo/GIS, especially remote sensing, adapted from a response to a letter in 2013.

I'm currently about to start a Geography degree at the University of [Redacted] at [Redacted] with a focus in GIS, and I've been finding that I have an interest in working with imagery. Obviously I should take Remote Sensing and other similar classes, but I'm the type of person who likes to self learn as well. So my question is this: What recommendations would you give to a student who is interested in working with imagery? Are there any self study paths that you could recommend?

I learned on my own and on the job, and there are a lot of important topics in GIS that I don’t know anything about, so I can’t give comprehensive advice. I haven’t arrived anywhere; I’m just ten minutes ahead in the convoy we’re both in. Take these recommendations critically.

Find interesting people. You’ll learn a lot more from a great professor (or mentor, or friend, or conference) o

@jlehtoma
jlehtoma / generate_shx.py
Created January 14, 2015 14:08
Re-create missing .shx-file for ESRI shapefiles
# Based on solution given here: http://geospatialpython.com/2011/11/generating-shapefile-shx-files.html
# Depends on pyshp
# Build a new shx index file
import fnmatch
import os
import shapefile
# List all the shapefiles
def find(pattern, path):
#!/usr/bin/env python
"""
Converts Internet Explorer 'capture network traffic' XML to a HAR file.
Turns out that XML is just a HAR file anyways, but in XML form. So this
just converts it to JSON, and Bob's your uncle.
Requires Python 2.7+ and LXML.
"""
from __future__ import unicode_literals
@celoyd
celoyd / hi8-anim-howto.md
Last active August 1, 2022 15:37
A way to make Himawari-8 animations

Himawari-8 animation tutorial

Here’s how to make animations like this one. It requires intermediate Unix command-line knowledge, to install some tools and to debug if they don’t work. You’ll need these utilities:

  • curl (or you can translate to wget)
  • convert and montage, part of ImageMagick
  • ffmpeg, plus whatever codecs
  • parallel, for iteration that’s nicer than shell for loops or xargs
  • run everything in zsh for leading 0s in numerical ranges to work
@revolunet
revolunet / backup.py
Last active October 14, 2022 22:12
download your google drive files with python
# -*- encoding: UTF-8 -*-
import os
import httplib2
# pip install --upgrade google-api-python-client
from oauth2client.file import Storage
from apiclient.discovery import build
from oauth2client.client import OAuth2WebServerFlow
@willurd
willurd / Getting started with requirejs.md
Last active December 14, 2022 08:15
A short introduction to require.js

This is a small collection of scripts showing how to use require.js. It's only one of several ways of setting up a require.js project, but it's enough to get started.

At its core, require.js is about three things:

  1. Dependency management
  2. Modularity
  3. Dynamic script loading

The following files show how these are achieved.

@andywirv
andywirv / output.tf
Created November 3, 2017 16:16
Multi-line Output for Terraform
output "SSH Config" {
value = <<SSHCONFIG
### START Auto-gen SSH Config for ${random_pet.cluster_id.id} ###
Host ${random_pet.cluster_id.id}-bastion
User core
Hostname ${aws_instance.bastion.public_ip}
IdentityFile ~/.ssh/${random_pet.cluster_id.id}.key
Host ${random_pet.cluster_id.id}-agent