Skip to content

Instantly share code, notes, and snippets.

@yulgit1
yulgit1 / gist:5f72f160183cdda2337f
Created September 6, 2015 23:37
application_controller_spec
[ermadmix@libdev controllers]$ more application_controller_spec.rb
require 'spec_helper'
describe ApplicationController do
describe "accessing ip_whitelist.yml" do
it "should have a number of ip addresses" do
ip_whitelist = YAML.load_file(Rails.root.join('spec','templates','ip_whitelist.yml'))
ips = ip_whitelist.fetch("whitelist")
expect(ips.size).to equal(3)
end
end
self.solr_search_params_logic = [:default_solr_parameters , :add_query_to_solr, :add_filter_conditions, :add_search_within, :add_facet_fq_to_solr, :add_facetting_to_solr, :add_solr_fields_to_query, :add_paging_to_solr, :add_sorting_to_solr ]
@yulgit1
yulgit1 / gist:a9e435d1bbdb00caa501
Created July 2, 2015 16:01
too large solr query (500) idconverter
[INFO] [talledLocalContainer] 2015-07-02 11:59:30,273 | DEBUG | TransformService | transform >> solr call: http://diego2.library.yale.edu:8083/solr/collection1/select?q=loc_rec_num_ssim%3A%22ms.mssa.1981%2Fref12925%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref549%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref55%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref550%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref551%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref552%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref553%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref554%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref555%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref556%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref557%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref558%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref559%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref56%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref560%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref561%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref562%22+OR+loc_
@yulgit1
yulgit1 / gist:8058a23404265f5695bd
Last active August 29, 2015 14:21
logging prod slowness
USERSESSION:QDMu5Qd3dh9wMUpE-oyrxGSoZgk
add/refresh session_id for cas/aeon user
CURRENT_USER:#<User id: 8088449, email: "[email protected]", encrypted_password: "$2a$10$IHy/eubsyENUJTISqNJ57ehHeYP9xUVllVaTy7t3F1iB...", res
et_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 64, current_sign_in_at: "2015-05-19 14:34:26", last_sig
n_in_at: "2015-05-19 14:16:01", current_sign_in_ip: "130.132.80.210", last_sign_in_ip: "130.132.80.210", created_at: "2015-03-26 17:45:59", updated_a
t: "2015-05-19 14:34:27", guest: false, session_id: "7xMBUGA0JsHM2poabji3s6QH8qo">
Rendered catalog/_facet_limit.html.erb (2.3ms)
Rendered catalog/_facet_limit.html.erb (3.6ms)
Rendered catalog/_facet_limit.html.erb (1.5ms)
Rendered catalog/_facets.html.erb (10.3ms)
@yulgit1
yulgit1 / gist:abcdfc930004e29bb4c3
Last active August 29, 2015 14:21
mvn:run fcrepo4
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java -Dmaven.multiModuleProjectDirectory=/Users/ermadmix/intellij/fcrepo4/fcrepo-webapp -Xmx512m -Dmaven.home=/Users/ermadmix/Applications/apache-maven-3.3.1 -Dclassworlds.conf=/Users/ermadmix/Applications/apache-maven-3.3.1/bin/m2.conf -Didea.launcher.port=7532 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 14.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Users/ermadmix/Applications/apache-maven-3.3.1/boot/plexus-classworlds-2.5.2.jar:/Applications/IntelliJ IDEA 14.app/Contents/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=14.0.3 jetty:run
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Fedora Repository Deployable Web Application 4.1.2-SNAPSHOT
[INFO] ------------------------------------------------------
@yulgit1
yulgit1 / gist:513cb490863c41fed5bf
Last active August 29, 2015 14:21
k2findit search conditionals
catalog controller:
search fields (in catalog controller):
"all_fields": default request handler, default_solr_params
"full_text": fulltext request handler (like default but including open and restricted fulltext in search), fq includes archivaldigitized
"full_text " :fulltext open request handler (like default but including open fulltext in search), fq including archivaldigitized
NOte: if full_text and not logged in then "full_text ", if logged in then "full_text"
filter query (fq) conditionals (in solr_helper):
if (global access and "all_fields") - remove restricted filter
if (global access and "fulltext") - remove restricted filter and add archivalDigitized
sysops-mbp:fcrepo4-vagrant ermadmix$ curl http://localhost:8080/fcrepo/rest/objects/cover/files/cover.jpg/fcr:metadata
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix nt: <http://www.jcp.org/jcr/nt/1.0> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix pcdm: <http://pcdm.org/models#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix test: <info:fedora/test/> .
@prefix fedoraconfig: <http://fedora.info/definitions/v4/config#> .
@prefix image: <http://www.modeshape.org/images/1.0> .
@prefix audit: <http://fedora.info/definitions/v4/audit#> .
Addded stored procedures:
Stored procedure name: lb_datehydraend
Input parameter: hpid
Replaces: update = @@client.execute(%Q/update dbo.hydra_publish set dateHydraEnd=GETDATE() where hpid=#{i["hpid"]}/)
Line : 299,309,332,351,370,497
Stored procedure name: lb_datehydraend_hydraid
Input parameter: hpid,hydraid
Replaces: str = %Q/update dbo.hydra_publish set hydraID='#{obj.pid}', dateHydraEnd=GETDATE() where hpid=#{i["hpid"]}
Line : 699
/**
* Copyright 2015 DuraSpace, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@yulgit1
yulgit1 / gist:6b040e00ae67dae624b3
Created March 18, 2015 18:11
yfad solr document
<doc>
<str name="PID">beinecke:irving</str>
<arr name="dc.contributor">
<str>Irving, Washington, 1783-1859.</str>
</arr>
<arr name="dc.creator">
<str>Irving, Washington, 1783-1859.</str>
</arr>
<arr name="dc.date">
<str>1802-1966</str>