Skip to content

Instantly share code, notes, and snippets.

@gloriousgeneralist
gloriousgeneralist / holidayhours.php
Created November 20, 2015 21:09
Code4Lib Chicago LibCal API demo
<?php
$holidays = json_decode(file_get_contents('your unique URL with your own API key and other settings goes here'),true);
if (!empty($holidays['events'])) {
echo "<p>The library will be closed for the following:</p>\n
<ul>";
foreach($holidays['events'] as $event) {
$holiday_date = date('D. M. j', strtotime($event['start']));
echo '<li><strong>'.$holiday_date.'</strong> '.$event['title'].'</li>';
}
'</ul>';
@gloriousgeneralist
gloriousgeneralist / cvjson
Last active August 29, 2015 13:57
ER&L 2014
[
{
"op": "core/column-split",
"description": "Split column Column 1 by separator",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "Column 1",
"guessCellType": true,
@gloriousgeneralist
gloriousgeneralist / gist:7223014
Last active December 26, 2015 22:29
Using jQuery for creating database outgoing links custom events. You obviously need to replace the 'a.db_name' with whatever class you wrap your database links in. If you are using this in Drupal, as I am, use instructions here to make your life easier when creating jQuery objects: https://drupal.org/node/171213#comment-4686396.
<!--Database custom events-->
<script type="text/javascript">
$(document).ready(function(){
$('a.db_name').each(function(){
var db_name = $(this).text();
$(this).click(function(){
_gaq.push(["_trackEvent", "linkOut", "database", db_name]); // create a custom event
});
});
});
@gloriousgeneralist
gloriousgeneralist / cvomatic
Created February 8, 2013 15:52
JSON for OpenRefine to transform a CV in APA style into columns and query SHERPA/RoMEO for publisher rights. See this blog post for full details: http://www.gloriousgeneralist.com/2013/02/analyzing-cvs-for-publisher-copyrights-and-self-archiving-with-openrefine/
[
{
"op": "core/column-split",
"description": "Split column Column 1 by separator",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "Column 1",
"guessCellType": true,