Skip to content

Instantly share code, notes, and snippets.

View cdmo's full-sized avatar

Charlie Morris cdmo

  • the middle of pennsylvania
  • X @cdmo
View GitHub Profile
---
# - name: Blacklight Solr | List zookeeper configsets
# uri: "{{ solr_install_path }}"/solr/admin/configs?action=LIST&omitHeader=true
# register: existing_configsets_list
- name: Blacklight Solr | Zip the current zookeeper configsets
archive:
path:
- "{{ rails_app_install_path }}/solr/conf/*"
DEPRECATION WARNING: The @document instance variable is deprecated and will be removed in Blacklight-marc 8.0 (called from render_refworks_action? at /Users/cdm32/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/bundler/gems/blacklight-marc-c0ff1d9cb5d3/lib/blacklight/marc/catalog.rb:25)
DEPRECATION WARNING: The @document instance variable is deprecated and will be removed in Blacklight-marc 8.0 (called from render_refworks_action? at /Users/cdm32/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/bundler/gems/blacklight-marc-c0ff1d9cb5d3/lib/blacklight/marc/catalog.rb:25)
DEPRECATION WARNING: The @document instance variable is deprecated and will be removed in Blacklight-marc 8.0 (called from render_endnote_action? at /Users/cdm32/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/bundler/gems/blacklight-marc-c0ff1d9cb5d3/lib/blacklight/marc/catalog.rb:29)
DEPRECATION WARNING: The @document instance variable is deprecated and will be removed in Blacklight-marc 8.0 (called from render_endnote_action? at /Users/cdm32/.rbenv/versions/2
@cdmo
cdmo / debug_query.json
Last active April 9, 2019 16:22
parsedquery_toString debug output of search on "geographic information systems"
"parsedquery_toString":"+(((
(series_title_tsim:geographic)^10.0 |
(title_245ab_tsim:geographic)^25000.0 |
notes_summary_ssim:geographic |
(author_unstem_search:geographic)^250.0 |
(subject_addl_tsim:geographic)^50.0 |
toc_ssim:geographic |
(subject_unstem_search:geographic)^750.0 |
all_text_timv:geographic |
(subject_addl_unstem_search:geographic)^250.0 |
@cdmo
cdmo / test_blacklight.py
Created April 4, 2019 12:20
Naive locust script to test home page loads, facet selections using our top genres and searches using animals and countries
from locust import HttpLocust, TaskSet
def index(l):
l.client.get("/")
def facet_genre(l):
import random
facet_genre_terms = ['Electronic books','Congresses','Periodicals','Early works to 1800','Biography','Maps','Streaming audio','Legislative hearings','Fiction','Legislative materials','Statistics','Handbooks, manuals, etc','Bibliography','Juvenile fiction','Scores','Case studies','Exhibitions','Electronic journals','Juvenile literature','History']
path = "/?f[genre_facet_ssim][]=%s&search_field=all_fields" % (random.choice(facet_genre_terms))
@cdmo
cdmo / eventracking.js
Created June 28, 2018 02:53
Event tracking for google analytics on the penn state bento search results page
function EventTrackingBento(element, category) {
var tags = {};
var category = category;
this.boxes = function() {
return document.querySelectorAll(element);
};
this.tagEvents = function() {
if (this.boxes) {
@cdmo
cdmo / .vimrc
Created December 13, 2017 13:13
set backspace=2 " backspace in insert mode works like normal editor
set shiftwidth=2 " indent by 2 spaces when auto-indenting
set softtabstop=2 " indent by 2 spaces when hitting tab
syntax on " syntax highlighting
filetype indent on " activates indenting for files
set autoindent " auto indenting
set number " line numbers
colorscheme desert " colorscheme desert
set nobackup " get rid of anoying ~file
function diff_mods { colordiff <(drush "$1" pml --status=enabled --pipe) <(drush "$2" pml --status=enabled --pipe); };
export -f diff_mods
# stolen from http://sourceforge.net/p/cosign/mailman/cosign-discuss/thread/4E302E4A.7050602@psulias.psu.edu/
# get your cookies
curl -L -b /tmp/cookies.txt -c /tmp/cookies.txt https://yourcosignlogin.com
# attempt to login
curl -L -b /tmp/cookies.txt -c /tmp/cookies.txt https://yourcosignlogin.com/cosign.cgi \
--data "login=username&password=password"
# now access your protected site
curl -L -b /tmp/cookies.txt -c /tmp/cookies.txt https://someothersite.com/pathtoresource
@cdmo
cdmo / Gruntfile.js
Created February 4, 2015 19:53
for zurb_foundation theme in drupal
module.exports = function(grunt) {
"use strict";
var theme_name = 'f5';
var global_vars = {
theme_name: theme_name,
theme_css: 'css',
theme_scss: 'scss'
}
.DS_*
._.DS_*
*.sass-cache*
styles/