Skip to content

Instantly share code, notes, and snippets.

@juhasch
juhasch / python-markdown.js
Created November 3, 2014 21:54
IPython notebook extension with some debugging output
// Allow Python-code in markdown cells
// Encapsulate using {{...}}
// - You can also return html or markdown from your Python code
// - You can embed images, however they will be sanitized on reload.
"use strict";
var pymd_extension = (function() {
"use strict";
var security = IPython.security;
var _on_reload = true; /* make sure cells with variables render on reload */
@juhasch
juhasch / bld.bat
Created October 14, 2014 17:31
Conda recipe for scikit-rf
"%PYTHON%" setup.py build --compiler=mingw32
"%PYTHON%" setup.py install
if errorlevel 1 exit 1
:: Add more build steps here, if they are necessary.
:: See
:: http://docs.continuum.io/conda/build.html
:: for a list of environment variables that are set during the build process.
@juhasch
juhasch / usrp_echotimer_cw.grc
Created July 27, 2014 19:29
gr-radar example with B210
<?xml version='1.0' encoding='ASCII'?>
<flow_graph>
<timestamp>Sat Jul 26 16:09:06 2014</timestamp>
<block>
<key>options</key>
<param>
<key>id</key>
<value>top_block</value>
</param>
<param>
@juhasch
juhasch / exception.diff
Created July 7, 2014 20:39
Diff file for run all, ignore exception
diff --git a/IPython/html/static/notebook/js/codecell.js b/IPython/html/static/notebook/js/codecell.js
index 44d4c79..bae3011 100644
--- a/IPython/html/static/notebook/js/codecell.js
+++ b/IPython/html/static/notebook/js/codecell.js
@@ -259,9 +259,13 @@ var IPython = (function (IPython) {
* Execute current code cell to the kernel
* @method execute
*/
- CodeCell.prototype.execute = function () {
+ CodeCell.prototype.execute = function (skip_exceptions) {
@juhasch
juhasch / gist:28e941a0ea6b1b6e47b8
Created July 7, 2014 05:43
Example Notebook for Code in Markdown Cell
{
"metadata": {
"name": "",
"signature": "sha256:3f216d8ac560f66c1a009e0f03595c7c2fc7d117803419f82d21cecb330525eb"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@juhasch
juhasch / NotebookExtensionsManager.ipynb
Last active August 29, 2015 14:02
First draft of a Notebook helping with Notebook Extensions
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@juhasch
juhasch / answer_buttons.js
Last active January 9, 2020 02:28
IPython extension snippet: Add answer buttons
"using strict";
var answer_buttons = (function() {
function add_buttons(){
console.log("runit");
$("div").each( function(){
if (this.className === 'answer') {
var button= '<input type="button" value="Answer" onclick="showHide(' + this.id + ')">';
this.insertAdjacentHTML("beforeBegin",button);
}
@juhasch
juhasch / custom.js
Last active August 29, 2015 13:58
IPython Notebook: Redefine Shift-Enter
var add_edit_shortcuts = {
'shift-enter' : {
help : 'run cell, select next codecell',
help_index : 'bb',
handler : function (event) {
IPython.notebook.execute_cell_and_select_below();
// find next CodeCell and go into edit mode if possible, else stay in next cell
var i;
for (i = IPython.notebook.get_selected_index(); i < IPython.notebook.ncells() ;i++) {
var cell = IPython.notebook.get_cell(i);
@juhasch
juhasch / gist:9812482
Created March 27, 2014 16:59
Strip spaces after first $ for math equations. Required to produce single-$ math equations when running IPython nbconvert --to=latex
from IPython.nbconvert.preprocessors import *
import re
class StripDollarSpacesPreprocessor(Preprocessor):
"""Remove spaces after leading '$' in math equations.
Make sure '$ a=10 $' is converted to '$a=10 $' and not '\$ a=10 \$'
when running nbconvert and pandoc
"""
@juhasch
juhasch / unit-conversions.ipynb
Last active August 29, 2015 13:56
Unit conversions using physical-quantities extension
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.