Skip to content

Instantly share code, notes, and snippets.

View gforsyth's full-sized avatar
🐗
Cinghiale

Gil Forsyth gforsyth

🐗
Cinghiale
View GitHub Profile
@gforsyth
gforsyth / README.md
Last active August 29, 2015 14:06 — forked from takluyver/README.md

Copy nbflatten.py to somewhere on $PATH. Then, in the root of a git repository, run these commands:

echo "*.ipynb diff=ipynb" >> .gitattributes 
git config diff.ipynb.textconv nbflatten.py

When you change a notebook and run git diff, you'll see the diff of flattened, simplified notebooks, rather than the full JSON. This does lose some information (metadata, non-text output), but it makes it easier to see simple changes in the notebook.

This doesn't help with merging conflicting changes in notebooks. For that, see nbdiff.org.

@gforsyth
gforsyth / HOWTO.Install.JSAnimation.md
Last active April 7, 2019 09:57
HOWTO: Install JSAnimation for IPython Notebook

##Download using git

You can git clone the library from Jake Vanderplas' GitHub repository: https://github.com/jakevdp/JSAnimation

git clone https://github.com/jakevdp/JSAnimation.git

##Download without git

@gforsyth
gforsyth / Burgers_Equation.ipynb
Last active October 27, 2015 21:39
Numerical Damping
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gforsyth
gforsyth / sympy.bigint.check.py
Created November 3, 2014 17:10
Checking if SymPy has a bug when calculating determinant of very big integers
import sympy
for i in range(100):
basicMatrix = sympy.randMatrix(14,14,-99,99)
powersMatrix = sympy.diag(10**123, 10**152, 10**185, 10**220, 10**397, 10**449, 10**503, 10**563, 10**979, 10**1059, 10**1143, 10**1229, 10**1319, 10**1412)
smallMatrix = sympy.randMatrix(14,14,-999,999)
bigMatrix = basicMatrix*powersMatrix + smallMatrix
a = bigMatrix.det()
b = bigMatrix.det()
@gforsyth
gforsyth / jekyll.py
Last active June 23, 2017 23:24 — forked from cscorley/jekyll.py
try:
from urllib.parse import quote # Py 3
except ImportError:
from urllib2 import quote # Py 2
import os
import sys
#BLOG_DIR = os.environ['BLOG_DIR']
BLOG_DIR = '/home/gil/gforsyth.github.io/'
@gforsyth
gforsyth / pr.md
Last active August 29, 2015 14:19 — 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:

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gforsyth
gforsyth / conda.md
Created July 14, 2015 14:56
conda reference

###Exporting

conda env export > environment.yml

###Importing existing environment from yaml file

conda env create --file=/path/to/envfile.yaml

##Including .inl files in TAGS

ctags -R -h "+.inl" --language-force=c++ .

#Intro to the command line

Welcome! The command can be one of the most powerful ways to interact with a variety of computer systems, but it can also be a little confusing at first glance. This mini-crash-course should help familiarize you with the basics of command line usage and navigation.

##Quick config step

This one bit we are asking you to do before we explain anything else. Please open up a terminal

Applications -> System Tools -> Terminal