Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Eric Ma ericmjl

🎯
Focusing
Block or report user

Report or block ericmjl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@killercup
killercup / pandoc.css
Created Jul 3, 2013
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%;
}
@dan-blanchard
dan-blanchard / .1.miniconda.md
Last active May 11, 2018
Quicker Travis builds that rely on numpy and scipy using Miniconda
View .1.miniconda.md

For ETS's SKLL project, we found out the hard way that Travis-CI's support for numpy and scipy is pretty abysmal. There are pre-installed versions of numpy for some versions of Python, but those are seriously out of date, and scipy is not there are at all. The two most popular approaches for working around this are to (1) build everything from scratch, or (2) use apt-get to install more recent (but still out of date) versions of numpy and scipy. Both of these approaches lead to longer build times, and with the second approach, you still don't have the most recent versions of anything. To circumvent these issues, we've switched to using Miniconda (Anaconda's lightweight cousin) to install everything.

A template for installing a simple Python package that relies on numpy and scipy using Miniconda is provided below. Since it's a common s

@fperez
fperez / ProgrammaticNotebook.ipynb
Last active Oct 19, 2019
Creating an IPython Notebook programatically
View ProgrammaticNotebook.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jakevdp
jakevdp / discrete_cmap.py
Last active Oct 10, 2019
Small utility to create a discrete matplotlib colormap
View discrete_cmap.py
# By Jake VanderPlas
# License: BSD-style
import matplotlib.pyplot as plt
import numpy as np
def discrete_cmap(N, base_cmap=None):
"""Create an N-bin discrete colormap from the specified input map"""
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.
@eigenfoo
eigenfoo / einsum_demo.py
Created Feb 3, 2019
Example of how Einstein notation simplifies tensor manipulations.
View einsum_demo.py
#!/bin/python
from time import time
import torch
batch_size = 128
image_width = 64
image_height = 64
num_channels = 3 # RGB, for instance.
You can’t perform that action at this time.