Skip to content

Instantly share code, notes, and snippets.

@rjof
rjof / convert_sp_geojson.r
Created November 22, 2019 15:19 — forked from filipkral/convert_sp_geojson.r
Convert between geojson and sp spatial objects in R
# Convert between geojson and sp spatial objects in R
require(rgdal)
# https://stat.duke.edu/~cr173/Sta523_Fa14/spatial_data.html
s <- '{ "type": "MultiPolygon", "coordinates": [
[ [[40, 40], [20, 45], [45, 30], [40, 40]] ],
[ [[20, 35], [10, 30], [10, 10], [30, 5], [45, 20], [20, 35]],
[[30, 20], [20, 15], [20, 25], [30, 20]]
]
]}'
@rjof
rjof / udemy.py
Created January 24, 2016 02:32
udemy.com video extraction tool. Works only if you bought a course and obtain a valid cookie.
import re
import requests
import json
import urlparse
from sys import stderr
def connect(url):
""" Extract source from passed URL. """
headers = {"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:30.0)"\