Skip to content

Instantly share code, notes, and snippets.

@p3trus
p3trus / custom.js
Last active September 26, 2019 07:58
Adds a button to the ipython notebook toolbar to hide/show the input code cell. To use it, you have to put the custom.js file in your `.ipython_<profile name>/static/custom/` folder, where *<profile name>* is the ipython profile in use.
$([IPython.events]).on('notebook_loaded.Notebook', function(){
IPython.toolbar.add_buttons_group([
{
'label' : 'toggle input cells',
'icon' : 'icon-refresh',
'callback': function(){$('.input').slideToggle()}
}
]);
});
@p3trus
p3trus / matplotlib bug.ipynb
Last active December 21, 2015 22:59
matplotlib bug in Axes3d
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.
@p3trus
p3trus / prbs.py
Last active August 29, 2015 14:09
Naive implementation of a pseudo random binary sequence generator.
import collections
from operator import xor
class PRBS(object):
"""Generates PRBS sequences.
E.g.::
# Generate a single period of a prbs7 sequence with
@p3trus
p3trus / beep.py
Last active August 29, 2015 13:56
beeping melodies :)
from winsound import Beep
import time
nationalhymne = [
(704, 750),
(792, 250),
(880, 500),
(792, 500),
(940, 500),
(880, 500),