Skip to content

Instantly share code, notes, and snippets.


Chris Keene chriskeene

View GitHub Profile
chriskeene / Alma.php
Created September 2, 2015 12:36
Alma get live holdings availability for vufind
View Alma.php
protected function curlMultiRequest($urls) {
$ch = array();
$results = array();
$mh = curl_multi_init();
foreach($urls as $key => $val) {
$ch[$key] = curl_init();
curl_setopt($ch[$key], CURLOPT_URL, $val);
//curl_setopt ($ch[$key], CURLOPT_FAILONERROR,1);
chriskeene / Alma.php
Last active August 27, 2015 14:32
Vufind Alma.php sample first attempt getHolding code
View Alma.php
$start_time = MICROTIME(TRUE);
function curlMultiRequest($urls, $options = array()) {
$ch = array();
$results = array();
$mh = curl_multi_init();
foreach($urls as $key => $val) {
$ch[$key] = curl_init();
chriskeene / primoaspire.js
Last active September 2, 2015 10:23
Show Aspire lists links in Primo
View primoaspire.js
$(function() {
// Aspire Reading Lists
// Get reading lists this item appears on.
// baseurl - url of Aspire tenancy
// outputstringprefix - html to add to front of list items in the Primo links list
// outputstringsuffix - html to add to end of list items in the Primo links list
View display only.xml
<title>Discovery services: next generation of searching scholarly information</title>
<creator>&lt;span class="searchword">Keene&lt;/span>, Chris</creator>
<publisher>United Kingdom Serials Group</publisher>
<identifier>; &lt;span class="searchword">Keene&lt;/span>, Chris (2011) Discovery services: next generation of searching scholarly information. Serials, 24 (2). pp. 193-196. ISSN 0953-0460</identifier>
<subject>ZA4050 Electronic information resources; ZA4450 Databases</subject>
<description>The new breed of resource discovery services is an evolutionary step forward in providing library users with a ‘one-stop shop’ where they can find information sources for their research. They provide a single search box that can search a library’s online and physical content including articles, books, journals, newspaper articles, e-books, specialist collections and more. T
chriskeene / pnx record for eprints.xml
Last active August 29, 2015 13:57
pnx record for eprints
View pnx record for eprints.xml
<record xmlns="" xmlns:sear="">
View dc as export from eprints.xml
<OAI-PMH xmlns="" xmlns:xsi="" xsi:schemaLocation="">
<request verb="GetRecord" identifier="" metadataPrefix="oai_dc"></request>
chriskeene / rules.diff
Last active August 29, 2015 13:57
Diff of rules.xml file for importing Eprints DC data
View rules.diff
< <conditionCode>21743174</conditionCode>
> <conditionCode>15451998</conditionCode>
< <sourceTag>dc:type</sourceTag>
> <sourceTag>dc:format</sourceTag>
< <conditionCode>21743176</conditionCode>
chriskeene / purchase order
Created February 26, 2014 16:07
simply jquery javascript purchase order form
View purchase order
<p>Access the <a href="/library/reports/purchaseform.php">OLD purchase order form here.</a></p>
// from
// this will add a new row of fields each time user clicks 'add extra line' button
//We will be using an unique index number for each new instance of the cloned form
var item_number_form_index=0;
//When the button is clicked (or Enter is pressed while it's selected)
chriskeene / gist:6278409
Last active December 21, 2015 08:29
Select all rows for a Financial year grouped by month, with a running total for the given year, and a all time running total. The underlying table stores dd/mm/yy in separate int fields.
View gist:6278409
SELECT Count(*) as "new items", e.datestamp_month, e.datestamp_year,
(select count(*) from eprint
where ((e.datestamp_year >= datestamp_year AND e.datestamp_month >= datestamp_month)
OR (e.datestamp_year > datestamp_year))
and `eprint_status` = "archive"
) AS "all time running total",
(select count(*) from eprint
where ((e.datestamp_year = 2012 AND e.datestamp_year = datestamp_year AND datestamp_month > 7 AND datestamp_month <= e.datestamp_month )
OR (e.datestamp_year = 2013 AND ((datestamp_year = 2012 AND datestamp_month > 7)
OR (datestamp_year = 2013 AND datestamp_month <= e.datestamp_month))
chriskeene / gist:5533427
Last active December 17, 2015 02:09
improved 'get the current load'
View gist:5533427
loadaverage=`uptime | awk -F"," '{print $4;}' | sed 's/^.*: //g' | sed 's/...$//g'`
if test $loadaverage -gt 7
echo "load is " $loadaverage
/opt/scratch/ >> loadout8.txt
top -b -n1 >> /opt/scratch/top.log