Skip to content

Instantly share code, notes, and snippets.

@little9
little9 / gist:4cdd617cc254424d5672
Last active August 29, 2015 14:01
CHC check exceptions
// Extend the Javascript Date() object to use full month names
Date.prototype.getMonthName = function(lang) {
lang = lang && (lang in Date.locale) ? lang : 'en';
return Date.locale[lang].month_names[this.getMonth()];
};
Date.prototype.getMonthNameShort = function(lang) {
lang = lang && (lang in Date.locale) ? lang : 'en';
return Date.locale[lang].month_names_short[this.getMonth()];
@little9
little9 / rails-checklist.md
Last active August 29, 2015 14:19
Rails Passenger Deployment Checklist
  • Here's an example Apache config (don't use friendly error pages in production):
Alias /aptrust-tracking /var/www/html/aptrust-tracking/public
    <Location /aptrust-tracking>
        PassengerBaseURI /aptrust-tracking
        PassengerAppRoot /var/www/html/aptrust-tracking
        PassengerFriendlyErrorPages on
    </Location>
 
{
"coordinates": null,
"created_at": "Thu Oct 21 16:02:46 +0000 2010",
"favorited": false,
"truncated": false,
"id_str": "28039652140",
"entities": {
"urls": [
{
"expanded_url": null,
@little9
little9 / thing.js
Created October 27, 2015 15:30
Object Literal Skeleton
var Thing = {
settings : {
},
strings : {
},
init : {
},
bindUiActions : {
},
customFunction : function() {
<?xml version="1.0" encoding="UTF-8"?>
<!-- Solr managed schema - automatically generated - DO NOT EDIT -->
<schema name="example" version="1.6">
<uniqueKey>id</uniqueKey>
<fieldType name="_bbox_coord" class="solr.TrieDoubleField" stored="false" useDocValuesAsStored="false" docValues="true" precisionStep="8"/>
<fieldType name="alphaOnlySort" class="solr.TextField" omitNorms="true" sortMissingLast="true">
<analyzer>
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.TrimFilterFactory"/>
@little9
little9 / install_mysql.sh
Last active July 18, 2016 17:06 — forked from rrosiek/install_mysql.sh
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Tested with Ubuntu 16.04.
#! /usr/bin/env bash
# Variables
DBHOST=localhost
DBNAME=sp
DBUSER=sp
DBPASSWD=grokgro3#3ogk3og3
echo -e "\n--- Mkay, installing now... ---\n"
https://na03.alma.exlibrisgroup.com/view/oai/01UOML_INST/request?verb=ListRecords&set=udvd&metadataPrefix=marc21&from=2016-07-01
@little9
little9 / hyrax_autocomplete.md
Last active March 15, 2017 01:02
Hyrax Autocomplete

Hyrax Autocomplete

You've got a Work in Hyrax and it has a Creator field. Wouldn't it be nice to have autocomplete on that form with a controlled vocabulary? Hyrax has this functionality, but you need to set some things up first.

The most basic way a field is associated with a particular autocomplete data source is with a data attribute on the element. The data-autocomplete-url attribute stores a path to the data source. To add one to an existing field create a partial for the field in app/views/records/edit_fields/.

In the partial, specify the data source:

Keybase proof

I hereby claim:

  • I am little9 on github.
  • I am jamielittle (https://keybase.io/jamielittle) on keybase.
  • I have a public key ASBtS9NKKPBQEg7jPHX9UczNwx4iXIN1IojUrKD6qP005wo

To claim this, I am signing this object:

{
"@context": "http://iiif.io/api/presentation/2/context.json",
"@type": "sc:Manifest",
"@id": "sample.pdf",
"label": "Multi-page PDF",
"description": "banana apple mango pineapple",
"sequences": [
{
"@type": "sc:Sequence",
"@id": "sample.pdf/sequence/normal",