Skip to content

Instantly share code, notes, and snippets.

View damianavila's full-sized avatar

Damian Avila damianavila

View GitHub Profile
@damianavila
damianavila / using_local_reveal.ipynb
Last active December 19, 2015 14:38
Config the Reveal exporter to use a local reveal.js library instead of a CDN.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python
"""
git fuzzy-checkout
Same as `git checkout branch`, but with fuzzy matching if checkout fails.
Turns `git checkout barnch` into `git checkout branch`,
assuming `branch` is a branch.
"""
import difflib
#!/usr/bin/env python
"""
git fuzzy-checkout
Same as `git checkout branch`, but with fuzzy matching if checkout fails.
Turns `git checkout barnch` into `git checkout branch`,
assuming `branch` is a branch.
"""
import difflib
@damianavila
damianavila / custom.css
Created August 12, 2013 14:18
Custom file to hidden scroll in IPython slides
.reveal {
overflow: visible;
}
@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 / 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 = [email protected]: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:

@damianavila
damianavila / test_slides.ipynb
Last active December 21, 2015 18:09
Example ipynb to test LIVE reveal extension.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/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())"
#!/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
@damianavila
damianavila / bokeh_template.py
Created March 18, 2014 23:39
Just a simple template to avoid starting with a blank page ;-)
"""A one-line description.
A longer description that spans multiple lines. Explain the purpose of the
file and provide a short list of the key classes/functions it contains. This
is the docstring shown when some does 'import foo;foo?' in IPython, so it
should be reasonably useful and informative.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved.
#