Skip to content

Instantly share code, notes, and snippets.

View camillevilla's full-sized avatar

Camille Villa camillevilla

View GitHub Profile
@camillevilla
camillevilla / gem_report.rb
Last active June 26, 2018 14:44
Report: major / minor / patch versions updated by bundler in several repos
# Assumes a folder of .txt files with `bundle update` output
major = []
minor = []
patch = []
repos_updated = []
Dir.foreach('./gem_report') do |repo|
next if (repo == '.') || (repo == '..')
repo_name = repo.chomp('.txt')
puts "#{'*' * 20 } #{repo_name} #{'*' * 20 }"
@camillevilla
camillevilla / humble-bundle-✨.js
Last active June 13, 2018 22:02
Bulk download humble bundle files
// Here ya go, dad! 2018-06-10
// Open Firefox
// Options / Preferences --> Tabs --> Open links in tabs instead of new windows
// Options / Preferences --> Applications --> PDF, Action: Save file
// Allow pop-ups from humblebundle.com
// With your Humble Bundle purchases tab open in Firefox:
// Firefox --> Web Tools --> Web Console
// Click the "Raw" button on this GitHub page and paste in the stuff below
@camillevilla
camillevilla / remove-gemnasium.sh
Created May 16, 2018 18:46
Remove gemnasium badges + make PRs
#!/bin/bash
cd $TMPDIR
mkdir -p $TMPDIR/.removegemnasium
cd $TMPDIR/.removegemnasium
for i in purl stacks sul-embed purl-fetcher content_search course_reserves discovery-dispatcher earthworks exhibits library_hours_rails sul-bento-app sul-directory sul-requests sw-indexer SearchWorks revs dlme arclight-demo vatican_exhibits revs-indexer-service bassi_veratti editstore-updater portfolios mods_display_app mirador_sul; do
echo $i
cd $TMPDIR/.removegemnasium
git clone git@github.com:sul-dlss/$i
cd $i
@camillevilla
camillevilla / github-pr-urls.js
Last active September 17, 2018 17:47
Grab GitHub PR URLs for weekly dependency updates
// v2.1
// even bettah! Links with sort order retained + links to "Files changed"
// PR search at https://github.com/pulls
// is:pr org:sul-dlss head:update-dependencies created:2018-05-08..2018-05-09
// Repo order used in our update script and status table
// https://gist.github.com/cbeer/efefe04222dfb27bfbe5cad2076e2e83
var repoList= "purl stacks sul-embed purl-fetcher content_search course_reserves discovery-dispatcher earthworks exhibits library_hours_rails sul-bento-app sul-directory sul-requests sw-indexer SearchWorks revs dlme arclight-demo vatican_exhibits revs-indexer-service bassi_veratti editstore-updater mods_display_app mirador_sul frda relevancy_dashboard stanford-arclight searchworks-status"
repoList = repoList.split(' ')
@camillevilla
camillevilla / reduce_fibonacci.rb
Created March 19, 2017 03:08
Fibonacci with Ruby's .reduce
# find the nth value of the Fibonacci sequence
def fibonacci(nth)
counter = 1
current_arr = [0, 1]
until counter == nth - 1
next_val = current_arr.reduce(0) {|sum, number| sum + number }
current_arr = [current_arr.last, next_val]
counter += 1
end
current_arr.last