Skip to content

Instantly share code, notes, and snippets.

View anusharanganathan's full-sized avatar

Anusha Ranganathan anusharanganathan

View GitHub Profile
@anusharanganathan
anusharanganathan / publishing_workflow.json
Created March 1, 2019 11:59
Mediated deposit workflow for publishing works
{
"workflows": [
{
"name": "publishing_workflow",
"label": "Mediated deposit workflow for publishing works",
"description": "A single-step workflow for mediated deposit in which all deposits must be approved by a reviewer. Reviewer may send deposits back to the depositor or reject a work from being published.",
"allows_access_grant": false,
"actions": [
{
"name": "deposit",
@anusharanganathan
anusharanganathan / fix_collection_translation_missing.rb
Created January 8, 2019 10:02
Gist to fix collections with name translation missing in Hyrax
# frozen_string_literal: true
# @todo remove when fixed upstream
# Taken from https://github.com/curationexperts/laevigata
# Run this if you are seeing Collections with a type of "translation missing..."
# Check YOUR_SERVER//dashboard/collections?locale=en for a place where this might appear
namespace :kingsf_hyku do
desc "Fix missing collection type labels"
task fix_collection_type_labels: :environment do
collection_types = Hyrax::CollectionType.all
@anusharanganathan
anusharanganathan / gist:72f4812d658a24104f1ca09428ac755d
Last active September 6, 2018 11:36
Howto:Solve problem of gems notloading in console, though available
.tooltip {
position: relative;
display: inline-block;
border-bottom: 1px dotted black;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 400px;
background-color: #646c7c;
@anusharanganathan
anusharanganathan / installoai.md
Last active November 22, 2017 12:10
Installing Ruby, Rails and OAI SOLR

Install Ruby and Rails using rbenv

Install Ruby using rbenv

  • Ruby version 2.4.2 rbenv install 2.4.2
  • Rails version 4.2.10 gem install rails -v 4.2.10

Create test app

rails _4.2.10_ new testapp

Notifications is workflow
https://github.com/samvera/hyrax/blob/master/app/services/hyrax/workflow/notification_service.rb#L55-L56
Change keys to strings from symbols. I then got the error
undefined method `primary_key' for String:Class
activerecord (5.1.3) lib/active_record/reflection.rb:679:in `primary_key'
activerecord (5.1.3) lib/active_record/reflection.rb:456:in `association_primary_key'
activerecord (5.1.3) lib/active_record/associations/belongs_to_association.rb:79:in `replace_keys'
<?xml version="1.0" encoding="windows-1252"?>
<!DOCTYPE rdf:RDF [
<!ENTITY xsd 'http://www.w3.org/2001/XMLSchema#'>
<!ENTITY xml 'http://www.w3.org/XML/1998/namespace#'>
<!ENTITY xs 'http://www.w3.org/2001/XMLSchema#'>
<!ENTITY rioxxterms '#'>
<!ENTITY dcterms 'http://purl.org/dc/terms/#'>
<!ENTITY dc 'http://purl.org/dc/elements/1.1/#'>
<!ENTITY vc 'http://www.w3.org/2007/XMLSchema-versioning#'>
]>
Log messages for https://github.com/growkudos/growkudos/blob/origin/feature/6759_loader_queue_logging_2/spec/lib/loader/processors/processor_spec.rb#L696-L711
evaluating bundle status for example-pub/success_adev_a_00059.xml. Current status is Initialising
would like to set status to pending
updating bundle status from Initialising to Pending
evaluating bundle status for /data/testpub/partial-failure.zip. Current status is Initialising
would like to set status to pending
updating bundle status from Initialising to Pending
evaluating bundle status for /data/testpub/partial-failure.zip. Current status is Initialising
@anusharanganathan
anusharanganathan / processify.py
Last active September 15, 2015 08:00 — forked from schlamar/processify.py
processify
import os
import sys
import traceback
from functools import wraps
from multiprocessing import Process, Queue
def processify(func):
'''Decorator to run a function as a process.