Skip to content

Instantly share code, notes, and snippets.

@carolyncole
carolyncole / settings.php
Last active February 7, 2020 13:06
settings.php for lando drupal 8 site for migration
<?php
// @codingStandardsIgnoreFile
/**
* @file
* Drupal site-specific configuration file.
*
* IMPORTANT NOTE:
* This file may have been set to read-only by the Drupal installation program.
@carolyncole
carolyncole / composer.json
Created February 6, 2020 14:47
Composer file for drupal 8 conversion
{
"name": "drupal/legacy-project",
"description": "Project template for Drupal 8 projects with composer following drupal/drupal layout",
"type": "project",
"license": "GPL-2.0-or-later",
"homepage": "https://www.drupal.org/project/drupal",
"support": {
"docs": "https://www.drupal.org/docs/user_guide/en/index.html",
"chat": "https://www.drupal.org/node/314178"
},
@carolyncole
carolyncole / gist:2466fe286e48fddae186092f43e7ce07
Created January 15, 2020 02:41
error that happened yesterday
deploy@library-prod3:/var/www/library_cap/current$ mysqldump libwww-prod
-- MySQL dump 10.13 Distrib 5.7.28, for Linux (x86_64)
--
-- Host: maria-prod.princeton.edu Database: libwww-prod
-- ------------------------------------------------------
-- Server version 5.7.28-31-57-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
@carolyncole
carolyncole / gist:23e62e6cee99c113be25032861ea4338
Created January 17, 2019 15:57
web packer advice for later from Joni
One word of advice, when the javascript and css files are pulled to build the manifest, the order that the files are included can effect whether the assets are built correctly. Charlie Morris had the same issue when using webpack with Blacklight. Fiddling with the order fixed it but I don’t have any logical reason why. ETDs have 3 different ‘sets’ of assets: base, author, and admin so it’s much more complicated than other applications. That may be part of the issue but who knows…. (edited)
@carolyncole
carolyncole / gist:77760544865ed32c435b0be327b95ae4
Last active January 9, 2019 17:29
replacing mimeType in fedora
ids = ActiveFedora::SolrService.query('*:*',fq: 'has_model_ssim:"ActiveFedora::DirectContainer"', fl: 'id', rows: ActiveFedora::DirectContainer.count).map{|resp| resp["id"]}
ids.each do |id|
container = ActiveFedora::DirectContainer.find(id) rescue next
if container.has_member_relation.first.id == "http://pcdm.org/models#hasFile"
container.contained.map(&:id).each do |uri|
id = ActiveFedora::Base.uri_to_id(uri)
file = Hydra::PCDM::File.find(id)
has_mime_type = file.metadata.attributes["http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#hasMimeType"].first
puts has_mime_type
new_has_mime_type = has_mime_type.gsub('scholarsphere.psu.edu','scholarsphere-stage.libraries.psu.edu').gsub('"','\\\\\\\\\"')
@carolyncole
carolyncole / gist:ea7437953ca9dd3909bfbf98213abaff
Created November 12, 2018 23:23
Remove all retried jobs from Failed Resque
i = 0
while i < Resque::Failure.count do
if Resque::Failure.all(i, 1)['retried_at'].present?
Resque::Failure.remove(i)
else
i += 1
end
end
@carolyncole
carolyncole / gist:e4d82ddfe8cd472ffbae7452560e7a1c
Created May 10, 2018 13:58
Poto Credits For Lesson Learned Poster
Glass bottles http://bit.ly/2iUh3qu
Fly Trap https://bit.ly/2HYDLcB
Microscope https://bit.ly/2I8aiJu
Squirrel http://bit.ly/2iEm0zL
Girl in mirror https://bit.ly/2I0AKIG
Monkeys http://bit.ly/2iqXkKS
Ink blot https://bit.ly/2wnQjoD
Bees http://bit.ly/2yamsjK
Garden http://bit.ly/2yaDjTO
Machinery http://bit.ly/2imDcxj
@carolyncole
carolyncole / console.md
Created January 11, 2018 18:34
Strange AutoSave Issue
collection = Collection.new({"title"=>["Test"], "subtitle"=>"", "creators"=>{"0"=>{"id"=>"", "given_name"=>"Lorraine C", "sur_name"=>"Santy", "display_name"=>"Lorraine C Santy", "email"=>"", "psu_id"=>""}}, "description"=>["Test Description"], "keyword"=>["test"], "contributor"=>[""], "rights"=>"", "publisher"=>[""], "date_created"=>[""], "subject"=>[""], "language"=>[""], "identifier"=>[""], "based_near"=>[""], "related_url"=>[""], "resource_type"=>[""], "visibility"=>"open", "permissions_attributes"=>{"0"=>{"type"=>"group", "name"=>"umg/course.1479EEE5-988A-3A80-6BF2-45421CAAB5C3", "access"=>"edit"}}})
collection.has_model  # ["Collection"]
collection.reload
collection.has_model  # []
https://gist.github.com/anonymous/04615caf1c21ee6d7cd3a370ac4a43bf
@carolyncole
carolyncole / gist:4e4103f186f9908141a913c7c530d772
Last active September 22, 2017 14:43
Steps for release information
Gather the release tags
```
git tag -l v* > releases.txt
```
Edit and reorder so the tags are in numberic order (v.1.1 moves after v1.0.)
Gather the differences between versions
```
FILE=releases.txt