Skip to content

Instantly share code, notes, and snippets.

View mjgiarlo's full-sized avatar
:shipit:
not updating my status

Michael J. Giarlo mjgiarlo

:shipit:
not updating my status
View GitHub Profile
@mjgiarlo
mjgiarlo / gist:1481594
Created December 15, 2011 15:53
Sample user story & acceptance criteria
User Stories
============
1. As an authorized user, I want to upload a copy of my dissertation to the repository services platform so that I can manage its preservation and dissemination.
2. ...
Acceptance Criteria
===================
Scenario 1: User is not authenticated
Given the user is an authorized user
And she has not yet authenticated
counts = Hash.new([])
Dir.glob('*/.rubocop.yml').each do |file|
YAML.load_file(file).tap do |cops|
cops
.select { |k, v| v.is_a?(Hash) && v.key?('Enabled') && !v['Enabled'] }
.each { |key| counts[key.first] += [file.split('/').first] }
end
end
@mjgiarlo
mjgiarlo / analytics_test.rb
Last active January 19, 2020 04:01
legato filtering out 0-result dates?
# Inspired by https://gist.github.com/3166610
require 'google/api_client'
require 'date'
API_VERSION = 'v3'
CACHED_API_FILE = "analytics-#{API_VERSION}.cache"
# Update these to match your own apps credentials
service_account_email = 'foobar@developer.gserviceaccount.com' # Email of service account
key_file = '/tmp/foobar-privatekey.p12' # File containing your private key
2.2.1 :003 > ActiveFedora::Noid::Service.new.mint
seed is 271030524290525531404955989783767342781
counters size is 293
@rand.rand(counters.size) is 261
counters[261] is {:value=>6300353125, :max=>6324492408}
counters[261][:value] is 6300353125
counters[261][:value] is now 6300353126
=> "vt150j25g"
2.2.1 :004 > ActiveFedora::Noid::Service.new.mint
seed is 271030524290525531404955989783767342781
@mjgiarlo
mjgiarlo / github-pr-urls.js
Created November 21, 2019 22:49 — forked from jcoyne/github-pr-urls.js
Grab GitHub PR URLs for weekly dependency updates
// Forked from https://gist.githubusercontent.com/camillevilla/16b53c50eccc11de0cb40ee0be7dcf03/raw/51f2473d5b04bb72e835ac9168381d87c0961d31/github-pr-urls.js
// 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://github.com/sul-dlss/access-update-scripts/blob/master/infrastructure/ruby
var repoList= "argo common-accessioning dlme dlme-harvest dlme-transform dor-services-app dor_indexing_app dor-fetcher-service gis-robot-suite google-books hydra_etd hydrus lyberservices-scripts modsulator-app-rails preservation_catalog preservation_robots pre-assembly repository-api rialto-etl rialto-webapp robot-console sul_pub sdr-services-app was-registrar-app was_robot_suite was-thumbnail-service workflow-server-rails"
repoList = repoList.split(' ')
ActiveRecord::Schema.define(version: 20_171_026_154_256) do
create_table 'resource_stats', id: :serial, force: :cascade do |t|
t.datetime 'date'
t.integer 'hits'
t.string 'hit_type'
t.string 'resource_id'
t.string 'resource_type'
t.datetime 'created_at', null: false
t.datetime 'updated_at', null: false
t.integer 'user_id'
@mjgiarlo
mjgiarlo / keybase.md
Last active February 26, 2018 18:58
keybase.md

Keybase proof

I hereby claim:

  • I am mjgiarlo on github.
  • I am mjgiarlo (https://keybase.io/mjgiarlo) on keybase.
  • I have a public key ASBn9_Wb6t6jYDaZm5p4GUcFtgGG-qbj7k04LHrK3fan0Qo

To claim this, I am signing this object:

InvertedHashOperator.new <= 'hash_key'
=> {"hash_key"=>#<InvertedHashOperator:0x00000002d67a20>}
diff --git a/Rakefile b/Rakefile
old mode 100644
new mode 100755
index a0ec74f..e5f6985
--- a/Rakefile
+++ b/Rakefile
@@ -9,22 +9,16 @@ Sulbib::Application.load_tasks
task default: [:ci]
desc 'Continuous integration task run on travis'
@mjgiarlo
mjgiarlo / admin_set_participants_feedback.md
Created March 14, 2017 23:01
Comments on Understanding Admin Sets Participants

Here are the divergences I found with https://github.com/projecthydra/sufia/wiki/Understanding-Admin-Sets-Participants

Admin Set Managers

  1. Admin Set managers can not currently edit Admin Set metadata until they are elevated to repository administrators. This is because only repository administrators can access the Admin Set edit UI, which is under /admin/. When an Admin Set manager deposits to an Admin Set, they have edit access.
  2. Admin Set managers can not edit works simply by virtue of being Admin Set managers; this is controlled by the work's ACLs still.

These two are yet-to-be-implemented features.

Admin Set Depositors