This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#via https://github.com/mysqludf/lib_mysqludf_json | |
#and https://github.com/mysqludf/lib_mysqludf_json/issues/2 | |
git clone git@github.com:mysqludf/lib_mysqludf_json.git | |
cd lib_mysqludf_json | |
gcc -v $(/usr/local/bin/mysql_config --cflags) -shared -fPIC -o lib_mysqludf_json.so lib_mysqludf_json.c | |
sudo ln -s lib_mysqludf_json.so /Applications/XAMPP/xamppfiles/lib/mysql/plugin/. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# With help from http://wiki.openstreetmap.org/wiki/Overpass_API/Language_Guide#Query_by_element_id | |
sudo pip install overpass | |
overpass --timeout 500 'way(272386359)' test.geojson |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://stackoverflow.com/questions/21320585/cannot-set-up-a-scrapy-project | |
export DYLD_LIBRARY_PATH=$HOME/anaconda/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyproj as pyproj | |
import pandas as pd | |
import numpy as np | |
df = pd.read_csv('SCOOT_Detectors.csv') | |
osgb36 = pyproj.Proj("+init=EPSG:27700") | |
eastnorth = np.apply_along_axis(func1d=lambda x: osgb36(x[0],x[1], inverse=True), arr=df[['EASTING', 'NORTHING']].values, axis=1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
# username@Machine ~/dev/dir[master]$ # clean working directory | |
# username@Machine ~/dev/dir[master*]$ # dirty working directory | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" |
The Natural Earth Gray Earth raster data set, reprojected to the U.S. National Atlas projection (a rotated Lambert azimuthal equal-area projection) via gdalwarp.
gdalwarp \
-r lanczos \
-ts 960 0 \
-t_srs EPSG:2163 \
-te -2100000 -2200000 2600000 750000 \
GRAY_HR_SR_OB_DR.tif \
shaded-relief.tiff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------------------------------- # | |
REFERENCES | |
# ----------------------------------------------------------------- # | |
http://ndpsoftware.com/git-cheatsheet.html | |
# ----------------------------------------------------------------- # | |
BASIC | |
# ----------------------------------------------------------------- # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
.link { | |
stroke: #000; | |
} | |
.node { | |
fill: #ccc; |
First attempt at making a colour-coded graph, with code snippets inspired from the D3 community.
Green => Friend and follower.
Red => Follower
Blue => Friend.
Improvements needed: