Skip to content

Instantly share code, notes, and snippets.

@Dyrcona
Dyrcona / laserdisc_fix.plx
Created July 28, 2015 14:38
A small script to fix DVD and possibly Blu-ray MARC records that say they are laserdisc in the 007.
#!/usr/bin/perl
# ---------------------------------------------------------------
# Copyright © 2015 Merrimack Valley Library Consortium
# Jason Stephenson <jstephenson@mvlc.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
@Dyrcona
Dyrcona / add_translations.py
Last active September 2, 2015 16:55
A program to assist with the process of adding new po and pot files into the Evergreen git repository.
#!/usr/bin/env python3
# -*- Mode: python; coding: utf-8 -*-
# ---------------------------------------------------------------
# Copyright © 2015 Jason J.A. Stephenson <jason@sigio.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
@Dyrcona
Dyrcona / stoopid.pl
Created December 6, 2012 22:10
Some kind of statement about perl
#!/usr/bin/perl
# Like all art, the interpretation is up to the viewer.
# Written 2012 by Jason Stephenson and Thomas Berezansky.
use strict;
use Data::Dumper;
@Dyrcona
Dyrcona / acceptitem.xml
Last active December 4, 2015 17:23
POST a file to a web URL. Intended to be used to test the NCIPServer NCIP responder for Evergreen/Koha.
<?xml version="1.0" encoding="utf-8"?>
<NCIPMessage version="http://www.niso.org/schemas/ncip/v2_02/ncip_v2_02.xsd" xmlns="http://www.niso.org/2008/ncip">
<AcceptItem>
<InitiationHeader>
<FromAgencyId>
<AgencyId></AgencyId>
</FromAgencyId>
<ToAgencyId>
<AgencyId></AgencyId>
</ToAgencyId>
@Dyrcona
Dyrcona / disbatcher.pl
Last active December 28, 2015 10:39
A utility to run a list of commands from a file.
#!/usr/bin/perl
# Copyright © 2013 Jason J.A. Stephenson <jason@sigio.com>
#
# disbatcher.pl is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# disbatcher.pl is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
@Dyrcona
Dyrcona / reingest_bibs.sql
Last active March 11, 2016 19:06
A simple, little SQL script to reingest bibs in Evergreen.
-- A simple SQL to "reingest" your bib records in Evergreen.
-- Feel free to use it however you like, though the easiest way is to
-- save it into a file and do psql -f filename.
DO $$
DECLARE
flag BOOLEAN;
BEGIN
SELECT enabled INTO flag
FROM config.internal_flag
@Dyrcona
Dyrcona / cperl_snippet.el
Last active January 1, 2017 21:44
My emacs cperl-mode configuration that conforms to the Evergreen coding guidelines.
;; Use cperl-mode by default
(defalias 'perl-mode 'cperl-mode)
;; cperl-mode doesn't have an add-style command, so we create our
;; style in a defun.
(defun evergreen-perl-style ()
"Set cperl-mode for Evergreen coding guidelines."
(setq cperl-indent-level 4
cperl-brace-offset 0
cperl-continued-brace-offset 0
/*
* real_bib_delete.sql
* Copyright (c) 2014 Bibliomation, Inc.
* Copyright (c) 2014 Jason Stephenson <jason@sigio.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
@Dyrcona
Dyrcona / cherrylog.py
Created August 21, 2015 14:58
A little fun with git, LibreOffice, and Python3....
#!/usr/bin/env python3
# -*- Mode: python; coding: utf-8 -*-
# ---------------------------------------------------------------
# Copyright © 2015 Jason J.A. Stephenson <jason@sigio.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
@Dyrcona
Dyrcona / lookup_user.pl
Last active December 10, 2020 15:56
Perl script to test NCIPServer with Evergreen. It sends a LookupUser message to see if the servier is running and configuration is OK.
#!/usr/bin/perl
# ---------------------------------------------------------------
# Copyright © 2019 Jason J.A. Stephenson <jason@sigio.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,