Skip to content

Instantly share code, notes, and snippets.

View eteq's full-sized avatar

Erik Tollerud eteq

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eteq
eteq / DtU17_snarkratio.ipynb
Last active March 3, 2017 04:34
DtU17 snark ratio
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

>>> import numpy as np >>> from astropy import units as u

Create a quantity from a pre-existing sampled distribution. The MC direction is the first dimension.

>>> parr = np.random.poisson([1, 5, 30, 400],(1000, 4)) >>> distr = u.Distribution(parr, u.kpc)

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eteq
eteq / get_gravatars.py
Created May 23, 2017 04:30
Script to get all the gravatars in a git repo
#!/usr/bin/env python
import os
import hashlib
import argparse
import subprocess
from urllib import request, error
start_dir = os.path.abspath('.')
travis_fold:start:worker_info Worker information
hostname: i-01f8c22-precise-production-2-worker-org-docker.travisci.net:fcda8efc-993c-4d11-bf2e-af481ae61f12
version: v2.5.0 https://github.com/travis-ci/worker/tree/da3a43228dffc0fcca5a46569ca786b22991979f
instance: 212aec9:travis:default
startup: 714.778688ms
travis_fold:end:worker_info travis_fold:start:system_info Build system information
Build language: c
Build group: stable
Build dist: precise
Build id: 248490114