Skip to content

Instantly share code, notes, and snippets.

View probablycorey's full-sized avatar
Dancing with my twin

Corey Johnson probablycorey

Dancing with my twin
View GitHub Profile


Tables Are Cool
col 1 is left-aligned $1600
col 2 is centered $12
col 3 is right-aligned $1
probablycorey / log.txt
Created June 11, 2019 22:27 — forked from pifafu/log.txt
Build log
carthage update --no-use-binaries --no-build
*** Fetching PINOperation
*** Checking out PINCache at "3.0.1-beta.8"
*** Checking out PINOperation at "1.1.2"
carthage build --no-skip-current
*** xcodebuild output can be found in /var/folders/6h/ql1brcjx3936vr5vwgblbnc80000rm/T/carthage-xcodebuild.tCygxC.log
*** Downloading PINOperation.framework binary at "Modernize PINOperation"
*** Downloading PINCache.framework binary at "Modernization"
*** Building scheme "PINRemoteImage-tvOS" in PINRemoteImage.xcodeproj
*** Building scheme "PINRemoteImage" in PINRemoteImage.xcodeproj

wow .


This is a thing

# Extract the unique routes from the data with their start and end coordinates
maps = df[['Route Id', 'Station Id From', 'Lat From', 'Lon From', 'Station Id To', 'Lat To', 'Lon To']].drop_duplicates()
maps['Distance'] = maps.apply(lambda x: distance.distance((x['Lat From'], x['Lon From']), (x['Lat To'], x['Lon To'])).km * 1000, axis=1)
# Merge the distance calculation with the main DataFrame
df = df.merge(maps[['Route Id', 'Distance']], how='left', on='Route Id')
df = df[[x for x in df.columns if not 'From' in x and not 'To' in x and x != 'Route Id']]
probablycorey /
Last active November 10, 2016 02:50
Bash function that enhances the `man` command
# Add this to your .bashrc or .zshrc file for a modern and sophisticated
# alternative to `man`.
function woman() {
man -t $1 | open -f -a /Applications/
probablycorey / wow.rb
Created September 23, 2016 23:07
Better date parsing
def parse_date_range(options)
from =[:from]) rescue ArgumentError
to =[:to]) rescue ArgumentError
to ||= from.try?(:next_day) || Date.current
from ||= to.begining_of_month
time_range =
days_in_range = (to - from).to_i
to = from + MAX_DAY_RANGE.days if days_in_range > MAX_DAY_RANGE
set -e
BRANCH=$(git branch | sed -n '/\* /s///p')
git branch --set-upstream-to=origin/$BRANCH $BRANCH
set -e
cd "$(dirname $0)/.."
probablycorey / i-do-not-know.rb
Created January 9, 2015 17:34
How do I unstage a staged deletion?
# Assume my-file.txt has been commited previously
repo =
# This will stage the file deletion
repo.index.remove("my-file.txt") # This doesn't work
# How do I "unstage" this deletion?
repo.index.add("my-file.txt") # This doesn't work... what will?
probablycorey / nodegit-bug.js
Created October 13, 2014 21:38
Nodegit bug
var git = require('nodegit');
var repo = null;
var repoPath = process.argv[2]
if(!repoPath) {
console.log("Usage: node nodegit-bug.js PATH_GIT_REPO")