View Nested.vue
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
<template> | |
<span> | |
<ol v-if="Array.isArray(value)"> | |
<li v-for="(item, index) in value" :key="index"> | |
<Nested :value="item" /> | |
</li> | |
</ol> | |
<ul v-else-if="typeof value == 'object' && !!value"> | |
<li v-for="(val, name) in value" :key="name"> | |
{{ name }}: |
View rstudio-cc.yml
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
#cloud-config | |
# In order to access RStudio server via the web interface, you must log on with | |
# a user account that allows password access. This script does not add that user | |
# by default. You may either ssh as root into the server and `adduser` as | |
# normal, or script a user addition here: | |
# users: | |
# - name: # username # | |
# lock-passwd: false # allow login with password |
View search.html
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
--- | |
layout: page | |
title: Search | |
noindex: true | |
--- | |
<script src="https://unpkg.com/lunr/lunr.js"></script> | |
<script> | |
const BUFFER = 30 // Number of characters to show for kwic-results |
View row_rep.R
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
row_rep <- function(df, n) { | |
df[rep(1:nrow(df), times = n),] | |
} |
View ffmpeg.sh
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
ffmpeg -i input.mov -t 12 -vf "fps=20,scale=640:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif |
View aat
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
'http://vocab.getty.edu/sparql.json?query=select+distinct*{?x+skos:inScheme+aat:;(xl:prefLabel|xl:altLabel)/gvp:term"' + escape(value, 'url') + '"@en}' |
View ceteicean_hypothesis_annotation.json
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
{ | |
"updated": "2018-10-01T18:16:02.140402+00:00", | |
"group": "__world__", | |
"target": [ | |
{ | |
"source": "http://teic.github.io/CETEIcean/EEBOTest.html", | |
"selector": [ | |
{ | |
"conformsTo": "https://tools.ietf.org/html/rfc3236", | |
"type": "FragmentSelector", |
View downsample_pdf.sh
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
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=OUTPUT.pdf INPUT.pdf |
View prefName.r
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(tidyverse) | |
library(httr) | |
get_prefname <- function(id) { | |
message(id) | |
endpoint <- "http://vocab.getty.edu/sparql.csv?query=" | |
query <- URLencode(str_interp("SELECT ?prefName WHERE { | |
?person dc:identifier '${id}'; | |
xl:prefLabel [xl:literalForm ?prefName ] . | |
} LIMIT 1")) |
View letter_position.r
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
letter_position <- function(s) { | |
comp_str <- stringr::str_split(stringr::str_to_lower(s), "") | |
purrr::map_int(comp_str, alpha_index) | |
} | |
alpha_index <- function(s) { | |
i <- purrr::map_int(s, ~ which(. == letters)) | |
purrr::reduce(i, function(x, y) { | |
x * length(letters) + y | |
}) |
NewerOlder