Skip to content

Instantly share code, notes, and snippets.

Charlie Morris cdmo

View GitHub Profile
View deprecation warnings.log
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 Apr 9, 2019
parsedquery_toString debug output of search on "geographic information systems"
View debug_query.json
"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 Apr 4, 2019
Naive locust script to test home page loads, facet selections using our top genres and searches using animals and countries
View test_blacklight.py
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 Jun 28, 2018
Event tracking for google analytics on the penn state bento search results page
View eventracking.js
function EventTrackingBento(element, category) {
var tags = {};
var category = category;
this.boxes = function() {
return document.querySelectorAll(element);
};
this.tagEvents = function() {
if (this.boxes) {
View .vimrc
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
View diff_mods.sh
function diff_mods { colordiff <(drush "$1" pml --status=enabled --pipe) <(drush "$2" pml --status=enabled --pipe); };
export -f diff_mods
View curl-auth-cosign.sh
# 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 Feb 4, 2015
for zurb_foundation theme in drupal
View Gruntfile.js
module.exports = function(grunt) {
"use strict";
var theme_name = 'f5';
var global_vars = {
theme_name: theme_name,
theme_css: 'css',
theme_scss: 'scss'
}
View .gitignore
.DS_*
._.DS_*
*.sass-cache*
styles/
View mdtalk.html
<!DOCTYPE html>
<html>
<head>
<title>Foo</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<style type='text/css'>
li {
margin-left: 60px;
}
You can’t perform that action at this time.