As configured in my dotfiles.
start new:
tmux
start new with session name:
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear! | |
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy. | |
* Off the top of my head * | |
1. Fork their repo on Github | |
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it | |
git remote add my-fork git@github...my-fork.git |
#!/usr/bin/env python | |
# Shannon Diversity Index | |
# http://en.wikipedia.org/wiki/Shannon_index | |
import sys | |
def sdi(data): | |
""" Given a hash { 'species': count } , returns the SDI | |
""" | |
Gets the name of the active Git branch as a string. | |
Depends on GitPython | |
pip install GitPython | |
""" | |
from git import Repo | |
repo = Repo('/path/to/your/repo') | |
branch = repo.active_branch |
As configured in my dotfiles.
start new:
tmux
start new with session name:
import re | |
def build_graph(files,exclude=['hdf5','h5lt','mpi']): | |
"""Build a dot graph of the Fortran modules in a list of files, | |
excluding modules named in the list exclude""" | |
# Start the graph | |
graph = "digraph G {\n" | |
deps = {} | |
p = re.compile("^(?:module|program) ([a-zA-Z0-9_]*)", |
Grab the brown and black knobs. You can also dial some of the numbers on the right.
Spherical coordinates are defined by ρ (rho, the distance from the origin), θ (theta, rotation parallel to the xy-plane), and φ (phi, inclination from the north pole to the south pole). This interactive drawing shows how they relate to the Cartesian xyz coordinates. The key is the horizontal slice of radius r.
Which makes sense: when φ=0, we're looking at the north pole, z=ρ and r=0. Then we're left with the familiar equations:
; The Expression Problem and my sources: | |
; http://stackoverflow.com/questions/3596366/what-is-the-expression-problem | |
; http://blog.ontoillogical.com/blog/2014/10/18/solving-the-expression-problem-in-clojure/ | |
; http://eli.thegreenplace.net/2016/the-expression-problem-and-its-solutions/ | |
; http://www.ibm.com/developerworks/library/j-clojure-protocols/ | |
; To begin demonstrating the problem, we first need some | |
; "legacy code" with datastructures and functionality: |
#!/bin/bash | |
# This script will check to see if a Docker image exists for a specific tag. | |
# Taken from here, with love: https://www.reddit.com/r/docker/comments/4hwdma/check_if_an_image_tag_for_a_private_repo_exists/ | |
TOKEN=$( curl -sSLd "username=${DOCKER_HUB_USERNAME}&password=${DOCKER_HUB_PASSWORD}" https://hub.docker.com/v2/users/login | jq -r ".token" ) | |
curl -sH "Authorization: JWT $TOKEN" "https://hub.docker.com/v2/repositories/${DOCKER_REPO}/tags/${DOCKER_TAG}/" | jq . | |
#{ | |
# "name": "latest", | |
# "id": 780668, |
{-# LANGUAGE NamedFieldPuns #-} | |
-- The Expression Problem and my sources: | |
-- http://stackoverflow.com/questions/3596366/what-is-the-expression-problem | |
-- http://blog.ontoillogical.com/blog/2014/10/18/solving-the-expression-problem-in-clojure/ | |
-- http://eli.thegreenplace.net/2016/the-expression-problem-and-its-solutions/ | |
-- http://www.ibm.com/developerworks/library/j-clojure-protocols/ | |
-- To begin demonstrating the problem, we first need some |