Andy Thomason is a Senior Programmer at Genomics PLC. He has been witing graphics systems, games and compilers since the '70s and specialises in code performance.
| #!/usr/bin/env python3 | |
| """A small example utility to demonstrate r2pipe scripting | |
| by extracting resources from a file. | |
| Written as an example for someone on IRC. | |
| --Towel, 2019 | |
| """ | |
| import r2pipe |
| license: mit |
| The MIT License (MIT) | |
| Copyright (c) Plotly, Inc | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
ESPN's hidden API endpoints
Latest News: http://site.api.espn.com/apis/site/v2/sports/football/college-football/news
Latest Scores: http://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard
| _pkgname="pulseaudio" | |
| pkgname="$_pkgname-hfp" | |
| pkgdesc="A featureful, general-purpose sound server" | |
| pkgver=tanuk.8367.af043266 | |
| pkgrel=1 | |
| arch=("i686" "x86_64" "armv7h") | |
| url="http://pulseaudio.org/" | |
| license=("GPL" "LGPL") | |
| depends=("rtkit" "libltdl" "speex" "tdb" "systemd" "fftw" "orc" "libsamplerate" | |
| "webrtc-audio-processing" "sbc" "libasyncns" "libxtst" "libsm" "libsndfile" "json-c") |
This little trick derives from the fact that the from_postgis class method is not really specific to postgis at all;
it will work with sqlalchmey or dbapi2 connections.
However, there are some peculiarities with spatialite that prevent this from being as simple as one might hope. There are two options:
-
The
pysqlite2driver works great for vanilla sqlite3 databases but spatialite requires loading an extension. In order to load extensions, you need to install a patched version and do some manual loading of the shared library. (seethe_pysqlite2_way.py) -
A better alternative is to use
pyspatialitebut installation is also a bit funky. I had to install from the current git master instead of the pypi version. The extension is loaded automatically. (seethe_pyspatialite_way.py)
