Skip to content

Instantly share code, notes, and snippets.

View joecannatti's full-sized avatar

Joe Cannatti joecannatti

View GitHub Profile
imgs=`find . -name \*.jpg | head -5`
img_args=$(for i in $imgs; do echo -n " -a $i "; done)
echo $'Hey Grandpa, \nI wrote a computer program to send you 5 pictures of Ari everyday until you\'re caught up. \nI think it\'s more fun to get 5 a day then to get them all at once.\nSorry you weren\'t on the list to begin with.' | \
mutt -s "Daily Ari Photos" $img_args -- [email protected] [email protected]
for i in $imgs; do
mv $i sent
done
namespace :responsys do
desc 'download and import Responsys events from FTP'
task load: :environment do
Resque.enqueue(LoadEventsJob)
end
Our Fields, unique key
RIID, (CUSTOMER_ID_, EMAIL_)
RIID, (CUSTOMER_ID_, EMAIL_)
class Rule
def self.add_reaction(reaction)
@reactions << reaction
end
end
class DuplicateFound < Rule
def match(records)
#dup logic
end
for i in `cat repo_list`; do git clone [email protected]: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
### 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:
@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'
@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 / 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 / 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 / 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"