Skip to content

Instantly share code, notes, and snippets.

Avatar

Eric Rochester erochest

View GitHub Profile
@erochest
erochest / git-whatmerged
Created Nov 9, 2018
Walks through the merge commits from the last day, and the diffs of what was merged.
View git-whatmerged
#!/bin/bash
since=yesterday
branch=$(git branch | grep \* | cut -d ' ' -f2)
while (( "$#" )); do
case "$1" in
-s|--since)
since="$2"
shift 2
@erochest
erochest / lib.rs
Last active Apr 18, 2018
Print 7-digit numbers
View lib.rs
#![feature(test)]
#[cfg(test)]
extern crate spectral;
extern crate test;
/// Takes a string containing a number and increments it in place. Returns whether the operation
/// was successful. The only time it isn't successful is if the input is empty or the operation
/// overflows.
///
@erochest
erochest / pm-powerhour.md
Created Mar 16, 2018
PM Powerhour presentation on XP
View pm-powerhour.md
title date
PM Power Hour presentation
27 March 2018

XP

History

1996

@erochest
erochest / myip.bash
Created Feb 2, 2018
Select your IP using fzf and copy it to the clipboard
View myip.bash
function myip() {
ifconfig | egrep -o '\d{1,3}(\.\d{1,3}){3}' | uniq | fzf | tee /dev/stderr | pbcopy
}
@erochest
erochest / index.html
Created Jan 18, 2018
Tracker Iteration Burnup
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Iteration Burnup</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<form>
View setup.sh
#!/bin/bash
echo "First, make sure your system's up-to-date and you have xcode installed."
echo "Let's get this out of the way."
sudo xcodebuild -license
echo "Getting the Pivotal workstation setup scripts."
curl https://github.com/pivotal/workstation-setup/archive/master.zip | unzip
mv workstation-setup workspace
rmdir workspace/pivotal_ide_prefs
View private.py
#!/usr/bin/env python3
class A:
def __phone_home(self):
print('A.__phone_home')
def phone_home(self):
print('From A')
self.__phone_home()
View ignore
*~
*.vim
.env
.env.fish
@erochest
erochest / upgrade-omeka
Created Feb 17, 2017
Upgrade script for Omeka
View upgrade-omeka
#!/bin/bash
TAG=$(git tag -l | tail -1)
echo "Upgrading to $TAG..."
echo
git stash save $TAG
git fetch origin
git checkout $TAG
View trans.py
import pandas as pd
import datetime
DATA_INPUT = 'data/nonpivoted_data.csv'
EPISODE_INPUT = 'data/toy_relabeled_episodes.csv'
def date(string):