View array_column.php
<?php
/**
* Implement the array_column() function built-in to PHP 5.5+
*/
if (!function_exists('array_column')) {
function array_column($inpt, $columnKey, $indexKey = false)
{
if ( $indexKey !== false ) {
$outp = array_combine(
array_map(function($element) use($indexKey){return $element[$indexKey];}, $inpt),
View bingspellcheck.php
<?php
// See https://www.microsoft.com/cognitive-services/en-us/bing-spell-check-api for API details.
namespace bing\spellcheck;
require_once('conf/base.conf.php');
function _getSuggestions($input) {
$subkey = MICROSOFT_COGNITIVE_API_KEY;
View animate.css
@charset "UTF-8";
/*!
* animate.css -http://daneden.me/animate
* Version - 3.5.1
* Licensed under the MIT license - http://opensource.org/licenses/MIT
*
* Copyright (c) 2016 Daniel Eden
*/
View librarything.php
<?php
namespace ocra\libraryThing;
/**
* Search LibraryThing's Common Knowledge API for a book and return and array with author/title and maybe year.
*/
function find_by_isbn($isbn) {
$lturl = 'http://www.librarything.com/services/rest/1.1/?method=librarything.ck.getwork&isbn=%s&apikey=%s';
$lturl = sprintf($lturl, $isbn, LIBRARYTHING_API_KEY);
View blink_sandbox.py
View Ocrify.user.js
// ==UserScript==
// @name Ocrify
// @namespace http://library.brown.edu/
// @version 0.1
// @description Try to reserve an item on Josiah.
// @author Adam Bradley <atb@brown.edu>
// @match https://search.library.brown.edu/catalog/*
// @grant none
// ==/UserScript==
View find_marc_field.php
<?php
/**
* Functions for treating (blacklight-based) Josiah as an API.
*/
namespace ocra\josiah;
/**
* Find a field (and optionally subfield) in the JSONified MaRCXML record.
*
View pinboard_remove_unread_tweets.py
USER_TOKEN = 'pinboard:ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
import re
import requests
import sys
import time
links = requests.get('https://api.pinboard.in/v1/posts/all?auth_token='+USER_TOKEN+'&format=json')#&count=100')
if links.status_code != 200:
View import_excel_workbook.R
library(readxl)
sheet_list <- lapply(excel_sheets('workbook.xlsx'), read_excel, path='workbook.xlsx')
View smode.R
smode <- function(x) {
which(tabulate(x)==max(tabulate(x)))
}