This file contains hidden or 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
// support ticket text, to be copied to clipboard later | |
var text = 'The link to this article\n\n' | |
// angular doc with metadata details | |
var doc = angular.element('.documentSummary').scope().document | |
var authors = doc.authors.reduce((text, author, idx, arr) => { | |
text += author.fullname | |
// it's _not_ the last author in the list | |
if (arr.length - idx != 1) { | |
text += ', ' | |
} |
This file contains hidden or 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
#!/usr/bin/env node | |
// given a set of item UUIDs, download all their attached files | |
// .equellarc file with credentials for API use | |
let options = require('rc')('equella', {}) | |
let headers = { 'X-Authorization': 'access_token=' + options.token } | |
const fs = require('fs') | |
const request = require('request') | |
// construct API URL |
This file contains hidden or 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
document.querySelector('.about-us-image-wrapper .about-us-image').src = '/media/images/GSuite_service.width-404.jpg' | |
document.addEventListener('DOMContentLoaded', main) | |
function main() { | |
var url = '/services/instructional-services-technology/g-suite-service/g-suite-news-updates/' | |
fetch(url).then((resp) => resp.text()) | |
.then((text) => { | |
// parse text of page to HTML we can navigate | |
var parser = new DOMParser() |
This file contains hidden or 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
// check if an item's staging directory contains the same files as its persistent storage does | |
function log(msg) { | |
logger.log(currentItem.getUuid() + "/" + currentItem.getVersion() + " LOGGER: " + msg); | |
} | |
// use staging API to check those files | |
if (staging.isAvailable()) { | |
var stagingFilesAndDirs = staging.listFiles("", "**"); | |
for(var i = 0; i < stagingFilesAndDirs.size(); i++) { | |
log(stagingFilesAndDirs.get(i)); |
This file contains hidden or 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
#!/usr/bin/env node | |
// a utility script for CCA to check for duplicate syllabi in VAULT | |
let defaults = { | |
uuid: '9ec74523-e018-4e01-ab4e-be4dd06cdd68', | |
// 50 is max length | |
length: 50, | |
term: 'Spring 2018', | |
} | |
// .equellarc file with credentials for API use | |
let options = require('rc')('equella', defaults) |
This file contains hidden or 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 | |
// this proxies ByWater Solutions' "COCE" cover image service | |
// which does not work over HTTPS, so fill in our libraries.cca.edu | |
// server as our COCE server & it intercepts requests, sending along | |
// data from ByWater's COCE server | |
// we're sending JS | |
header( 'Content-Type:application/javascript; charset=utf-8' ); | |
// requests look like |
This file contains hidden or 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
#!/usr/bin/env fish | |
# remove leading zeroes from JPG file names | |
# e.g. page001.jpg => page1.jpg | |
set start (pwd) | |
for dir in (ls) | |
echo "About to rename files in $dir" | |
# optional, makes me less afraid when I step through one folder at a time | |
read |
This file contains hidden or 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
#!/usr/bin/env python | |
# usage: | |
# sum-majors.py "LI - Library students per term.csv" > "YEAR majors total.csv" | |
import csv | |
import fileinput | |
import sys | |
majors = csv.DictReader(fileinput.input(mode='rb')) | |
# mapping of degree codes to majors will change over time | |
# as will the "totals" dict below listing our majors |
This file contains hidden or 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
#!/usr/bin/env node | |
// usage: | |
// > randpw | |
// IKS1L2H1AMOx | |
// > randpw --length 22 | |
// IKS1L2H1AMOxBs4d8qxDXY | |
// > randpw | pbcopy # pipe to Mac clipboard | |
var chance = new require('chance')() | |
var args = require('minimist')(process.argv.slice(2)) | |
var pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890' |
This file contains hidden or 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
// see also: https://gist.github.com/phette23/5575987 | |
// used to count edits at California College of the Arts | |
// during Art+Feminism edit-a-thon on March 7, 2015 | |
var uns = [ | |
"Phette23", | |
"Circa73", | |
"Flyingpanther", | |
"Tericlaude", | |
"Berylbev", | |
"Cd heaven", |