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 / 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(' ')
require 'hydra/datastream/rights_metadata'
module Hydra
module Datastream
class RightsMetadata < ActiveFedora::NokogiriDatastream
class PermissionsViolation < ::RuntimeError
end
# Validates permissions changes
def validate_permissions(type, actor, access_level)
# do some validations, throw some errors, whatever
raise PermissionsViolation if [type, actor, access_level] == [:person, "person123", "edit"]
@mjgiarlo
mjgiarlo / gist:326689
Created March 9, 2010 15:21 — forked from rsinger/gist:325368
Benchmarking scripts in different languages. Scripts open a 19GB JSON file and do stuff with it.
perl 5.10.0:
real 97m48.002s
user 92m7.045s
sys 1m5.712s
python 2.6.4:
real 91m8.783s
user 85m40.705s
sys 1m0.568s