Skip to content

Instantly share code, notes, and snippets.


Eric Ma ericmjl

View GitHub Profile
ericmjl /
Last active Aug 29, 2015
How to identify whether there exists a path between two nodes in an undirected graph
Author: Eric J. Ma
Affiliation: Massachusetts Institute of Technology.
Purpose of Code:
This code was written because I did not find a sufficiently-concise way of identifying whether
two nodes were connected by some path. Bidirectional Djikstra as implemented in NetworkX returns
False is not connected, but (length, path) if connected; I wanted a pure "True/False"
In response to Stack Overflow question:
def batpower(power):
if power >= 70:
return "good"
elif power <= 70 and power > 30:
return "ok"
elif power <= 30:
ericmjl / .travis.yml
Created Jul 16, 2015
.travis.yml file
View .travis.yml
language: python
# We don't actually use the Travis Python, but this keeps it organized.
- "2.7"
- "3.4"
sudo: false
# We do this conditionally because it saves us some downloading if the
View .gitignore
# Byte-compiled / optimized / DLL files
# C extensions
# Distribution / packaging
View bindot.pyx
# distutils: extra_compile_args = -O2 -w
# cython: boundscheck=False, nonecheck = False, wraparound=False, cdivision=True
import numpy as np
cimport numpy as np
import operator as op
from cython.parallel import prange
from cython import boundscheck, nonecheck, wraparound
import os
import click
packages = ['circos', 'hiveplot', 'pandoc-attributes',
'pandoc-fignos', 'pandoc-xnos', 'pandocfilters',
'twine', 'lektor']
# for f in os.listdir(os.getcwd()):
# if ".sh" in f:
# os.system("bash {0}".format(f))
ericmjl /
Created Sep 15, 2016 — forked from cwharland/
Find all packages installed by both conda and pip
conda list | tr -s ' ' | cut -d ' ' -f1 | uniq -c | awk '$1>1'
View Simple GP.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
ericmjl /
Created Dec 15, 2016 — forked from aaronwolen/
Pandoc template to generate reveal.js slideshows.

% Title % Name % Date

My first slide


ericmjl / pandoc.css
Created Jan 13, 2017 — forked from killercup/pandoc.css
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
View pandoc.css
* I add this to html files generated with pandoc.
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;