Skip to content

Instantly share code, notes, and snippets.

@cfitz
cfitz / bulk_update.rb
Last active June 23, 2016 16:44
A way to bulk update objects in ArchivesSpace
#!/usr/bin/env ruby
require 'json'
require 'rest_client'
require "highline/import"
# This is a way to bulk update objects in ArchivesSpace using a JSON template
# It's in Ruby and you'll need to have rest_client and highline installed ( gem install rest_client highline )
# run it with ruby ./bulk_update.rb
# good luck and backup and use at your own risk!
@wsalesky
wsalesky / git-sync.xql
Last active August 19, 2019 08:58
Sync remote eXistdb with github repository automatically using github webhooks.
xquery version "3.0";
(:module namespace gitsync = "http://syriaca.org/ns/gitsync";:)
(:~
: XQuery endpoint to respond to Github webhook requests. Query responds only to push requests.

: The EXPath Crypto library supplies the HMAC-SHA1 algorithm for matching Github secret. 

:
: Secret can be stored as environmental variable.
: Will need to be run with administrative privileges, suggest creating a git user with privileges only to relevant app.