Skip to content

Instantly share code, notes, and snippets.

View BibMartin's full-sized avatar

Martin Journois BibMartin

View GitHub Profile
ssh -N -f -L localhost:8800:localhost:8800 user@server
@BibMartin
BibMartin / GeoPandas.ipynb
Created December 10, 2015 11:17
Transform and plot shapefile data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@BibMartin
BibMartin / gist:12244602ac0b1c5995c8
Created January 19, 2016 15:20
Using `xargs` and `sed` to apply a function to a set of files
Imagine you have a folder containing many files, and you want to apply a function to those files.
ls *.ipynb | sed 's/.ipynb//' | xargs -i echo {}.ipynb-{}.log
If you're in a folder containing `foo.ipynb`, `bar.ipynb`, 'baz.py`, you'll get:
foo.ipynb-foo.log
bar.ipynb-bar.log
@BibMartin
BibMartin / link.md
Last active January 23, 2016 10:18
Good tutorial for building `conda` packages
@BibMartin
BibMartin / main.md
Created January 26, 2016 13:45
Create and enable a kernel for jupyter notebook with conda
conda create -n py27 python=2.7 ipykernel
source activate py27

python -m ipykernel install --user --name py27 --display-name "Python 2.7"

@BibMartin
BibMartin / main.md
Created January 26, 2016 13:45
Create and enable a kernel for jupyter notebook with conda
conda create -n py27 python=2.7 ipykernel
source activate py27

python -m ipykernel install --user --name py27 --display-name "Python 2.7"

@BibMartin
BibMartin / HowTo embed python-nvd3 chart in folium.ipynb
Last active February 7, 2016 11:06
HowTo embed python-nvd3 chart in folium
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@BibMartin
BibMartin / test_continuum_repo.py
Created February 25, 2016 10:49
Test continuum repo consistency
import requests, re
import numpy as np
import pandas as pd
out = pd.Series([])
for i in range(10):
r = requests.get('https://repo.continuum.io/pkgs/free/linux-64/')
assert r.ok
libs = re.findall('<tr>\s*<td>.*?>(.*?)</a></td>', r.text, re.DOTALL)
assert len(libs) == len(re.findall('<tr>\s*<td>(.*?)</td>', r.text, re.DOTALL))