Skip to content

Instantly share code, notes, and snippets.

View jasloe's full-sized avatar
💭
I may be slow to respond.

Jason Loeffler jasloe

💭
I may be slow to respond.
View GitHub Profile
@jasloe
jasloe / gist:7269852
Last active December 27, 2015 04:49
media feature configuration
/* media_default_view.inc contains: */
$view = new view();
$view->name = 'media_default';
$view->description = 'Default view for the media browser library tab.';
$view->tag = 'media, default';
$view->base_table = 'file_managed';
$view->human_name = 'Media browser';
$view->core = 7;
$view->api_version = '3.0';
@jasloe
jasloe / gist:fa59a9a97cb0ce05a5aa
Last active August 29, 2015 14:04
sql statement for exporting records from Koha
SELECT i.biblionumber, i.itemnumber, i.barcode, i.itemcallnumber, i.location, i.itype, b.title, b.author, i.enumchron, ExtractValue(bi.marcxml,'//datafield[@tag="830"]/subfield[@code="a"]') AS Series830, ExtractValue(bi.marcxml,'//datafield[@tag="490"]/subfield[@code="a"]') AS Series490, ExtractValue(bi.marcxml,'//datafield[@tag="440"]/subfield[@code="a"]') AS Series440 FROM items i LEFT JOIN biblio b using (biblionumber) JOIN biblioitems bi using (biblionumber)
@jasloe
jasloe / gist:13a195bf9a26276034e5
Created August 26, 2014 20:55
Example MySQL SELECT statement to parse MARC data for import via Adobe Bridge
SELECT CONCAT(REPLACE(items.itemcallnumber,".","_"),".tif") AS filename,
items.itemcallnumber AS title,
ExtractValue(biblioitems.marcxml,'//datafield[@tag="500"]/subfield[@code="a"]') AS description,
CONCAT_WS(" ",biblio.title,ExtractValue(biblioitems.marcxml,'//datafield[@tag="245"]/subfield[@code="h"]')) as headline,
items.dateaccessioned as "date created",
CONCAT_WS(" ",ExtractValue(biblioitems.marcxml,'//datafield[@tag="100"]/subfield[@code="a"]'),
@jasloe
jasloe / gist:a06c88a2d2da40d51979
Created April 29, 2015 21:42
Aspace EAD XML to Koha-ready MARCXML
<!-- EAD XML output from ASpace
-->
<unittitle>[Pompeii (Italy), Region VI.14.38 : House of C. Poppaeus Firmus, back W wall] [graphic].</unittitle>
<!-- need to transform to Koha-ready MARCXML, e.g.
-->
<datafield tag="245" ind1="0" ind2="0">
<subfield code="a">[Pompeii (Italy), Region VI.14.38 : House of C. Poppaeus Firmus, back W wall]</subfield>
@jasloe
jasloe / gist:8d04aa7cd9cf8350e664
Last active September 2, 2015 21:48
rt between augustus and db servers
#
# 1 MB packets between augustus and caligula (old)
#
augustus :: /home/jl » ping -c 10 -s 1024 10.0.1.10
PING 10.0.1.10 (10.0.1.10) 1024(1052) bytes of data.
1032 bytes from 10.0.1.10: icmp_seq=1 ttl=64 time=0.609 ms
1032 bytes from 10.0.1.10: icmp_seq=2 ttl=64 time=0.674 ms
1032 bytes from 10.0.1.10: icmp_seq=3 ttl=64 time=0.640 ms
1032 bytes from 10.0.1.10: icmp_seq=4 ttl=64 time=0.662 ms
1032 bytes from 10.0.1.10: icmp_seq=5 ttl=64 time=0.599 ms
<record xmlns:mx="http://www.loc.gov/MARC21/slim">
<leader>00000cz a2200000n 45 0</leader>
<controlfield tag="001">oca00281654 </controlfield>
<controlfield tag="003">OCoLC</controlfield>
<controlfield tag="005">20101119063145.0</controlfield>
<controlfield tag="008">790523n| acannaabn |n aaa </controlfield>
<datafield ind1=" " ind2=" " tag="010">
<subfield code="a">n 79048317 </subfield>
</datafield>
<datafield ind1=" " ind2=" " tag="040">
@jasloe
jasloe / desgranges.json
Created January 14, 2016 21:31
ArchivesSpace output of Des Granges collection level (JSON)
{
"lock_version": 1,
"title": "Des Granges Collection, 1860-1890",
"publish": true,
"restrictions": true,
"created_by": "admin",
"last_modified_by": "admin",
"create_time": "2014-10-15T23:36:00Z",
"system_mtime": "2015-10-28T20:03:35Z",
"user_mtime": "2015-07-28T18:34:47Z",
@jasloe
jasloe / desgranges.ead.xml
Created January 14, 2016 21:35
ArchivesSpace output of Des Granges collection level (EAD)
<?xml version="1.0" encoding="utf-8"?>
<ead xmlns="urn:isbn:1-931666-22-9" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:isbn:1-931666-22-9 http://www.loc.gov/ead/ead.xsd"><eadheader countryencoding="iso3166-1" dateencoding="iso8601" langencoding="iso639-2b" repositoryencoding="iso15511"><eadid countrycode="IT" mainagencycode="IT-ltRAAR"></eadid><filedesc><titlestmt><titleproper>Des Granges Collection, 1860-1890<num>PA.AAR.DesGranges</num></titleproper></titlestmt><publicationstmt><publisher>Photograph Archive of the American Academy in Rome</publisher></publicationstmt></filedesc><profiledesc><creation>This finding aid was produced using ArchivesSpace on <date>2016-01-14 21:24:50 +0000</date>.</creation></profiledesc></eadheader><archdesc level="collection">
<did>
<langmaterial>
<language langcode="eng">English</language>
</langmaterial>
<repository>
<corpname>Photograph Archive of the American Academy in Rom
@jasloe
jasloe / desgranges.tree.json
Last active January 14, 2016 21:45
ArchivesSpace output of Des Granges tree view (JSON)
{
"lock_version":1,
"title":"Des Granges Collection, 1860-1890",
"publish":true,
"restrictions":true,
"created_by":"admin",
"last_modified_by":"admin",
"create_time":"2014-10-15T23:36:00Z",
"system_mtime":"2015-10-28T20:03:35Z",
"user_mtime":"2015-07-28T18:34:47Z",
[
{
"lock_version":0,
"position":0,
"publish":true,
"ref_id":"80485e2ddebb388068d52783554ba142",
"title":"AAR.COSA.1970.87",
"display_string":"AAR.COSA.1970.87",
"restrictions_apply":true,
"created_by":"archeoziggy",