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
#!/bin/sh | |
# Can be used to create a merged bibliography from a set of exported collectiions | |
# list files by name length: | |
MAINCOLLECTION=`ls *.bib | perl -e 'print sort { length($a) <=> length($b) } <>' | head -n 1` | |
MAINROOT=$(echo "$MAINCOLLECTION" | cut -f 1 -d '.') | |
rm -f "$MAINCOLLECTION Bibliography.md" # In case we already created one before | |
for FILE in *.bib |
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
#!/usr/bin/env python3 | |
# Requires pypinyin, can be installed with pip: https://github.com/mozillazg/python-pinyin | |
# Thanks to XerCis on CSDN: https://blog.csdn.net/lly1122334/article/details/105380586 | |
# Example: psort file-with-Chinese-words-on-each-line.txt | |
import sys | |
from pypinyin import pinyin, Style | |
from itertools import chain |
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
# Here is a workaround for lack of pause in curl: | |
# example: | |
# kurl 20 “http://myurl.com/[1-10].jpg” | |
# Will download with a 20 second pause | |
# Assumes $1 is pause in seconds between requests | |
# Assumes $2 is URL, with [x-y] as range inside it | |
# Assumes output is .jpg file | |
if [ -z "$1" ] 2> /dev/null; then | |
echo "No parameters found. Exiting." |
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
# This is a wrapper for: https://github.com/lovasoa/dezoom.sh | |
# Running that command can be tedious if you have a regular URL pattern from openSeaDragon, | |
# such as the NLA format: https://nla.gov.au/[some image id]/dzi?tile=14/44_38.jpg | |
# Running this will prompt you for the url pointing to the highest X_Y tile and will | |
# then construct the appropriate dezoom.sh command using -X and -Y parameters | |
# it assumes you have wget and ImageMagick installed, and that the dezoom.sh file | |
# is in the same directory. | |
echo Paste in the highest tile on zoom level 14: | |
read fullurl |
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
javascript:(function(){p=prompt('Find book or ebook at St Andrews by Keyword:','');if(p){document.location.href='https://encore.st-andrews.ac.uk/iii/encore/plus/C__S'+escape(p)+'__Ff%3Afacetfields%3Atitle%3Atitle%3ATitle%3A%3A__Orightresult__U__X0__T?lang=eng&suite=def'};})(); |
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
javascript:(function(){p=prompt('Find book or ebook at St Andrews by Keyword:','');if(p){document.location.href='https://encore.st-andrews.ac.uk/iii/encore/plus/C__S'+escape(p)+'__Orightresult__U__X0__T?lang=eng&suite=def'};})(); |
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
# assumes dezoom.sh is in the same directory | |
# assumes list.txt containing URLs on separate lines to each of the NLA maps | |
# the URL should point to the jpg to the tile in the bottom right of the seadragon zoom tiles | |
# NLA offers jpg and tiff download but former is low resolution and latter are way too massive in size | |
# echo Paste in the highest tile on zoom level 14: | |
listfile="/Users/kml/shell/list.txt" | |
lines=`cat $listfile` | |
totallines=`grep -c ".*" list.txt` | |
count=0 | |
for line in $lines; do |
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
-- This is a really stripped down and simple version of | |
-- Daniel Shockley's DocInfo, which I had trouble getting | |
-- to work on pandoc converted unicode files. | |
-- Thanks to him for the original script: | |
-- DocInfo (for Skim) | |
-- version 1.0, Daniel A. Shockley, http://www.danshockley.com | |
-- http://www.danshockley.com/files/DocInfo.scpt | |
tell application "Skim" | |
set docName to name of document 1 |
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
function! WC() | |
if getline(1) != '' | |
if &modified || !exists("b:wordcount") | |
let l:old_status = v:statusmsg | |
let position = getpos(".") | |
execute "silent normal g\<c-g>" | |
let b:wordcount = str2nr(split(v:statusmsg)[11]) | |
let v:statusmsg = l:old_status | |
call setpos('.', position) | |
return b:wordcount |
NewerOlder