This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
smode <- function(x) { | |
which(tabulate(x)==max(tabulate(x))) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(readxl) | |
sheet_list <- lapply(excel_sheets('workbook.xlsx'), read_excel, path='workbook.xlsx') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Functions for treating (blacklight-based) Josiah as an API. | |
*/ | |
namespace ocra\josiah; | |
/** | |
* Find a field (and optionally subfield) in the JSONified MaRCXML record. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from blinkstick import blinkstick | |
from matplotlib import cm, colors | |
from time import sleep | |
cmap = cm.get_cmap('coolwarm') | |
def getColor(n): | |
colr = cmap(n)[0:3] | |
outp = [x * .15 for x in colr] | |
adj = [x * .25 if x == max(colr) else x*.15 for x in colr] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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), |