Skip to content

Instantly share code, notes, and snippets.

View carrickr's full-sized avatar

Carrick Rogers carrickr

  • Kensington, CA, USA
View GitHub Profile
@carrickr
carrickr / components.connection-rater\.js
Last active November 19, 2020 23:02 — forked from ejuher/components.connection-rater\.js
Connection Rater Interview
import Component from '@glimmer/component';
export default class extends Component {
constructor() {
super(...arguments);
// connections is provided here and is the same as @connections in the hbs file
const connections = this.args.connections
// 1) Apply the class "alert-info" to the first connection
let current_active_position = 0 ;
@carrickr
carrickr / tesim_ssim_compare.rb
Created November 9, 2016 14:36
compare old dublincore and new dc field
#Run me headless via: RAILS_ENV=production nohup ./rails runner "eval (File.read 'tesim_ssim_compare.rb')" &
require 'rsolr'
# Settings
model_field = 'has_model_ssim'
models = {media_object: 'info:fedora/afmodel:MediaObject', master_file: 'info:fedora/afmodel:MasterFile',collection: 'info:fedora/afmodel:Admin_Collection'}
solr_url = 'http://localhost:8983/solr/avalon_r5'
commit_every = 1000 # how many docs to commit on
max_rows = 999_999
@carrickr
carrickr / model_based_reindex.rb
Last active November 28, 2016 16:56
For reindexing Avalon Solr cores based purely on model
# Run me headless via: RAILS_ENV=production nohup ./rails runner "eval (File.read 'model_based_reindex.rb')" &
require 'rsolr'
# Settings
model_field = 'has_model_ssim'
models = {media_object: 'info:fedora/afmodel:MediaObject', master_file: 'info:fedora/afmodel:MasterFile',collection: 'info:fedora/afmodel:Admin_Collection'}
solr_url = 'http://localhost:8983/solr/avalon_r5'
commit_every = 1000 # how many docs to commit on
max_rows = 999_999