Skip to content

Instantly share code, notes, and snippets.

View ianozsvald's full-sized avatar

Ian Ozsvald ianozsvald

View GitHub Profile
gabraganca / output_toggle_html.tpl
Last active February 15, 2017 17:37
Template to use with `ipython nbconvert` when generating HTML. With this, all input cell are hidden. Thanks @damianavila for the initial setup ( I have also take some code from the `custom.css` of @olgablot published in
{%- extends 'full.tpl' -%}
{% block input_group -%}
<div class="input_hidden">
{{ super() }}
{% endblock input_group %}
{%- block header -%}
{{ super() }}
ogrisel /
Last active October 16, 2021 10:05
Hackish script to generate asciidoc from an IPython notebook JSON file.
"""Hackish script to convert a notebook into
Note that the content of markdown cells is not translated: it is assumed to
hold asciidoc content instead (even if it does not render correctly in the
browser editing the notebook file).
This script could be improved to use pandoc to handle the conversion instead.
Sample usage:
anonymous /
Created June 30, 2012 13:16
Google Speech to Text script
arecord -D plughw:1,0 -f cd -t wav -d 3 -r 16000 | flac - -f --best --sample-rate 16000 -o out.flac; wget -O - -o /dev/null --post-file out.flac --header="Content-Type: audio/x-flac; rate=16000" | sed -e 's/[{}]/''/g'| awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]; exit }' | awk -F: 'NR==3 { print $3; exit }'
diogojc /
Created November 25, 2011 19:55
parameterizing and plotting Power Laws in python (Zipf example)
import numpy as np
def powerLaw(y, x):
'When the frequency of an event varies as power of some attribute of that
event the frequency is said to follow a power law.' (wikipedia)
This is represented by the following equation, where c and alpha are
y = c . x ^ alpha