Skip to content

Instantly share code, notes, and snippets.

View val99erie's full-sized avatar

Valerie Maher val99erie

  • Canada
View GitHub Profile
@val99erie
val99erie / complete_task_from_dashboard_spec.rb
Last active February 21, 2021 15:26
A Rails system spec. The user has tasks on their dashboard, similar to a to-do list. They can click a check button to complete a task.
# frozen_string_literal: true
require 'rails_helper'
require 'support/login'
RSpec.describe "Finishing tasks from dashboard:", type: :system, js: true do
let(:project) { Project.create!(title: 'Test Project') }
let!(:task_1) { project.tasks.create!(title: 'T111') }
let!(:task_2) { project.tasks.create!(title: 'T222') }
let(:new_task) { Task.find_by_title('T333') }
# frozen_string_literal: true
# See the comments in the ProjectPositionSequencer class for info about how the gaps are set
# for the "position" of the Project records.
# Goals of this class:
# * Reset the positions so that they have proper gaps between records.
# * Try to perform the updates in fewer SQL queries, so that it's not 1 update per record.
# Assumption: It's okay if the update takes a long time. For now, the rebalancer is rarely
@val99erie
val99erie / gist:ddfe4d8f225c8eb5fd9aae844b835740
Created March 30, 2017 21:20
Specs failing in hydra-derivatives in Valerie's dev env
Failures:
1) Hydra::Derivatives::AudioDerivatives.create with a filename creates derivatives
Failure/Error: remote_file.mime_type = m_type
Ldp::BadRequest:
Prefix http has not been registered
# /Users/valerie/.rvm/gems/ruby-2.3.3@hydra-derivatives/gems/ldp-0.6.4/lib/ldp/client/methods.rb:119:in `block in check_for_errors'
# /Users/valerie/.rvm/gems/ruby-2.3.3@hydra-derivatives/gems/ldp-0.6.4/lib/ldp/client/methods.rb:117:in `tap'
# /Users/valerie/.rvm/gems/ruby-2.3.3@hydra-derivatives/gems/ldp-0.6.4/lib/ldp/client/methods.rb:117:in `check_for_errors'
@val99erie
val99erie / gist:26037200e01d673c24daf10d9623701c
Created March 30, 2017 18:39
Video derivatives in Hyrax
How are video derivatives done in hyrax?
1. In hyrax app/jobs/create_derivatives_job.rb
it calls:
file_set.create_derivatives(filename)
2. In hyrax app/services/hyrax/file_set_derivatives_service.rb
the create_derivatives method calls:
create_video_derivatives(filename)
@val99erie
val99erie / require.log
Created October 18, 2016 20:59
Requiring files at Rails console startup
999 requiring: /Users/valerie/.rvm/gems/ruby-2.3.1@cc/gems/devise-4.2.0/app/controllers/devise/confirmations_controller
999 requiring: /Users/valerie/.rvm/gems/ruby-2.3.1@cc/gems/devise-4.2.0/app/controllers/devise_controller
999 requiring: devise/controllers/scoped_views
999 requiring: devise/confirmations_helper
999 requiring: /Users/valerie/.rvm/gems/ruby-2.3.1@cc/gems/devise-4.2.0/app/controllers/devise/omniauth_callbacks_controller
999 requiring: devise/omniauth_callbacks_helper
999 requiring: /Users/valerie/.rvm/gems/ruby-2.3.1@cc/gems/devise-4.2.0/app/controllers/devise/passwords_controller
999 requiring: devise/passwords_helper
999 requiring: /Users/valerie/.rvm/gems/ruby-2.3.1@cc/gems/devise-4.2.0/app/controllers/devise/registrations_controller
999 requiring: devise/registrations_helper
@val99erie
val99erie / already_loaded.out
Created September 30, 2016 21:29
Files that are already loaded when it tries to load Embargoable
#<Set:
{
"/Users/valerie/.rvm/gems/ruby-2.3.1@cc/gems/hydra-core-10.3.0/app/helpers/blacklight_helper",
"/Users/valerie/.rvm/gems/ruby-2.3.1@cc/gems/hydra-core-10.3.0/app/helpers/hydra/blacklight_helper_behavior",
"/Users/valerie/.rvm/gems/ruby-2.3.1@cc/gems/blacklight-6.7.1/app/helpers/blacklight/blacklight_helper_behavior",
"/Users/valerie/.rvm/gems/ruby-2.3.1@cc/gems/blacklight-6.7.1/app/helpers/blacklight_url_helper",
"/Users/valerie/.rvm/gems/ruby-2.3.1@cc/gems/blacklight-6.7.1/app/helpers/blacklight/url_helper_behavior",
"/Users/valerie/.rvm/gems/ruby-2.3.1@cc/gems/blacklight-6.7.1/app/helpers/blacklight/deprecated_url_helper_behavior",
"/Users/valerie/.rvm/gems/ruby-2.3.1@cc/gems/blacklight-6.7.1/app/helpers/blacklight_configuration_helper",
"/Users/valerie/.rvm/gems/ruby-2.3.1@cc/gems/blacklight-6.7.1/app/helpers/blacklight/configuration_helper_behavior",