Skip to content

Instantly share code, notes, and snippets.

View joecannatti's full-sized avatar

Joe Cannatti joecannatti

View GitHub Profile

Hey! I was writing this up as a potential future project, and it occurred to me that this is a great time to share it to the eng team. It’s heavily related to some problems we are running into with migrating to our new payments infrastructure.

If you have anything to add, please add it as a comment, because I am suggesting this as a real project to be undertaken sometime in the future.

Project Idea: Reimagining the Task Lifecycle

One of the absolute foundational aspects of the TaskRabbit system is the progression of a Task from its creation to its completion by a Tasker. Along the way we create a bunch of different entities in the database. Those entities are often used to signify the progress of the Task through its Lifecycle. Things like:

@joecannatti
joecannatti / daily_phish_transcription.sh
Last active June 19, 2023 16:44
Fetch the most liked Phish song performed on this day and setup tools to transcribe
#!/usr/bin/env bash
#
# setup on mac:
# brew install jq
PHISH_TOKEN="[REDACTED]"
DAY=`date +%m-%d`
API_BASE="http://phish.in/api/v1/"
DAILY_URL="$API_BASE/shows-on-day-of-year/$DAY"
METADATA_FILENAME="daily-phish-$DAY.json"
@joecannatti
joecannatti / security_now.sh
Last active July 30, 2016 21:07
Security Now Episode Downloader
#!/usr/bin/env sh
set -e
CURRENT_SN=570
for i in $(seq -f "%03g" 1 $CURRENT_SN); do
echo "episode $i"
@joecannatti
joecannatti / heart_sutra.sh
Created April 26, 2016 20:30
Heart Sutra Bash Script
function heart_sutra {
text="Av a lo kit e sh var a Bod hi satt va, when deep ly prac tic ing praj ña par a mit a, clear ly saw
that all five agg re gates are emp ty and thus re lieved all suf fer ing. Shar i put ra, form
does not dif fer from empt i ness, empt i ness does not dif fer from form. Form it self is
empt i ness, empt i ness it self form. Sen sat ions, per cept ions, form at ions, and
con scious ness are al so like this. Shar i put ra, all dharm as are marked by empt i ness;
they neith er a rise nor cease, are neith er de fil ed nor pure, neith er in crease nor
de crease. There fore, giv en empt i ness, there is no form, no sen sat ion, no per cept ion,
no form at ion, no consciousness; no eyes, no ears, no nose, no tongue, no bo dy, no
mind; no sight, no sound, no smell, no taste, no touch, no ob ject of mind;
@joecannatti
joecannatti / bundle_update.sh
Last active April 7, 2016 19:35
Update Bundle update
# requires that have installed hub, https://github.com/github/hub
git checkout master && git reset --hard origin/master && git pull origin master && git checkout -b gem-update-`date +%Y-%m` && gem install bundler && bundle update && rake && git add -A && git commit -m "Bundle update `date +%Y-%m`" && git push origin gem-update-`date +%Y-%m` && hub pull-request -m "Bundle update `date +%Y-%m`"; if [[ $? = 0 ]]; then echo "SUCCESS"; else echo "FAIL"; fi;
@joecannatti
joecannatti / count_process_types.sh
Created March 21, 2016 20:06
Count Heroku Process Types
for app in `heroku apps --org stitchfix-enterprise | tail -n +2`; do heroku ps:type -a $app | grep -v cost/mo | grep -v -- -----; done | awk '{print "1"}' | xargs | sed 's/ /+/g'
@joecannatti
joecannatti / count_dynos.sh
Created March 21, 2016 20:06
Count Heroku Dynos for an Org
for app in `heroku apps --org stitchfix-enterprise | tail -n +2`; do heroku ps:type -a $app | grep -v cost/mo | grep -v -- -----; done | awk '{print $3}' | xargs | sed 's/ /+/g'
### Keybase proof
I hereby claim:
* I am joecannatti on github.
* I am joecannatti (https://keybase.io/joecannatti) on keybase.
* I have a public key whose fingerprint is 3F85 533B B2D7 166D C5FB A47F 0545 EF55 2A97 24C6
To claim this, I am signing this object:
for i in `cat repo_list`; do git clone git@github.com:stitchfix/$i.git; done
mkdir logs
mkdir data
for app in $(find . -type d -maxdepth 1 -mindepth 1 | grep -v ".git" | sed 's/\.\///'); do dirs -c; pushd $app; parent=`dirs +1`; eval logpath=$parent/$app.log; git log --date=iso > $logpath; popd; done;
find . -name \*log -maxdepth 1 -exec mv '{}' logs \;
pushd logs
for i in `find . -name \*log`; do cat $i | egrep -v '^commit' | egrep -v '^Merge' | egrep -v '^$' | egrep -v '^\s+' | perl -0pe 's/(.*)\nDate: (.*)\n/$1,$2\n/g' | sed 's/^Author: //' | sed 's/,\s*/,/'| sed "s|$|,${i}|" | sed 's/\.\///' | sed 's/\.log//'; done > all_commits
popd
cp logs/all_commits data
cat all_commits | awk -F'<' '{print $2}' | sed s/\>// > all_commits_by_email
class Rule
def self.add_reaction(reaction)
@reactions << reaction
end
end
class DuplicateFound < Rule
def match(records)
#dup logic
end