Skip to content

Instantly share code, notes, and snippets.

View damianavila's full-sized avatar

Damian Avila damianavila

View GitHub Profile
@damianavila
damianavila / remove_output.py
Created April 3, 2013 22:05
Remove output from IPython notebook from the command line (dev version 1.0)
"""
Usage: python remove_output.py notebook.ipynb [ > without_output.ipynb ]
Modified from remove_output by Minrk
"""
import sys
import io
import os
from IPython.nbformat.current import read, write
@damianavila
damianavila / ipynb_run_save.py
Created March 20, 2013 20:49
Run and save a ipynb file from the command line. This script is working in dev version (1.0) of IPython (for previous version you have to tweak it). It will generate a new "run & saved" notebook.
#!/usr/bin/env python
"""
Script for running and save notebooks from command line.
How to use: `ipynb_run_save.py foo.ipynb
Some tweaks over ipydoctest.py from minrk
by @damianavila
"""
@damianavila
damianavila / Dockerfile
Created August 14, 2019 22:44
Test jupyter_logging extension
FROM jupyter/scipy-notebook:2ce7c06a61a1
# Add jupyter_logging
RUN conda install -c damianavila82 jupyter_logging --no-deps
# And config the extension with the proper keys
COPY jupyter_logging.json /opt/conda/etc/jupyter/jupyter_notebook_config.d/jupyter_logging.json
@damianavila
damianavila / data_science_con_python.ipynb
Created April 10, 2015 11:07
Talk about Python tools for Data Science (spanish)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@damianavila
damianavila / fixme.py
Created August 12, 2013 14:19
A little snippet to fix print issues in IPython slides.
# -*- coding: utf-8 -*-
#----------------------------------------------------------------------------
# Copyright (c) 2013 - Damián Avila
#
# Distributed under the terms of the Modified BSD License.
#
# A little snippet to fix @media print issue printing slides from IPython
#-----------------------------------------------------------------------------
@damianavila
damianavila / custom.css
Created August 12, 2013 14:18
Custom file to hidden scroll in IPython slides
.reveal {
overflow: visible;
}
#!/usr/bin/env python
"""A script to generate and serve the slides from a ipython notebook
that auto updates the slides. It would be nice to include something like
this in IPython. Usage:
>>> python serve_slides.py presentation.ipynb
"""
import sys
#!/bin/bash
# This hook is run after a new virtualenv is activated.
# ~/.virtualenvs/postmkvirtualenv
libs=( PyQt4 sip.so )
python_version=python$(python -c "import sys; print (str(sys.version_info[0])+'.'+str(sys.version_info[1]))")
var=( $(which -a $python_version) )
get_python_lib_cmd="from distutils.sysconfig import get_python_lib; print (get_python_lib())"
@damianavila
damianavila / test_slides.ipynb
Last active December 21, 2015 18:09
Example ipynb to test LIVE reveal extension.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@damianavila
damianavila / pr.md
Created August 17, 2013 12:28 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: