Skip to content

Instantly share code, notes, and snippets.

View tillahoffmann's full-sized avatar

Till Hoffmann tillahoffmann

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tillahoffmann
tillahoffmann / tensorflow_serialisation.ipynb
Created July 28, 2016 13:48
Serialisation of tensorflow models without using collections
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.
@tillahoffmann
tillahoffmann / instance-method-line-profiling.ipynb
Created April 21, 2016 08:55
Trying to profile cython instance methods line by line
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.
@tillahoffmann
tillahoffmann / citiesToCities.csv
Created March 1, 2016 12:37
Airport network for practical.
We can't make this file beautiful and searchable because it's too large.
"departure city","long. departure (decimal)","lat. departure (decimal)","departure country","arrival city","long. departure (decimal)","lat. departure (decimal)","arrival country","number of routes","distance"
"Sao Paulo",-46.116,-23.054,"Brazil","Rio De Janeiro",-42.74,-22.682,"Brazil",18,348
"Rio De Janeiro",-42.74,-22.682,"Brazil","Sao Paulo",-46.116,-23.054,"Brazil",18,348
"Beijing",116.974,40.133,"China","Shanghai",122.342,31.238,"China",18,1100
"Johannesburg",28.41,-25.566,"South Africa","Cape Town",19.002,-33.942,"South Africa",16,1299
"Honolulu",-157.871,21.531,"United States","Tokyo",140.643,36.274,"Japan",16,6103
"Tokyo",140.643,36.274,"Japan","Honolulu",-157.871,21.531,"United States",16,6103
"Tokyo",140.643,36.274,"Japan","Seoul",126.75,37.781,"South Korea",15,1243
"Seoul",126.75,37.781,"South Korea","Tokyo",140.643,36.274,"Japan",15,1243
"Tokyo",140.643,36.274,"Japan","Los Angeles",-118.014,34.57,"United States",15,8691
@tillahoffmann
tillahoffmann / docstring_magic.py
Created June 11, 2015 09:30
IPython line magic to generate numpy-style docstring stubs.
from IPython.core.magic import Magics, magics_class, line_magic
import inspect, re
# The class MUST call this class decorator at creation time
@magics_class
class TahMagics(Magics):
@line_magic
def docstring(self, line):
"""
Generate a numpy-style docstring.
@tillahoffmann
tillahoffmann / docstring_magic.ipynb
Created June 11, 2015 09:14
IPython line magic to generate numpy-style docstring stubs.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tillahoffmann
tillahoffmann / mathjax_simplenote.js
Last active November 8, 2016 13:12
JavaScript to add MathJax support to Simplenote web app.
if (window.MathJax === undefined) {
//Add the MathJax script
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML";
var config = 'MathJax.Hub.Config({' + 'extensions: ["tex2jax.js"],' + 'tex2jax: { inlineMath: [["$","$"],["\\\\\\\\\\\\(","\\\\\\\\\\\\)"]], displayMath: [["$","$"],["\\\\[","\\\\]"]], processEscapes: true },' + 'jax: ["input/TeX","output/HTML-CSS"]' + '});';
if (window.opera) {
script.innerHTML = config
} else {
script.text = config
@tillahoffmann
tillahoffmann / cython_line_profiler.ipynb
Created February 3, 2015 14:48
Demonstration of line-by-line profiling for `cython` functions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.