Skip to content

Instantly share code, notes, and snippets.

@zuphilip
zuphilip / field-report.js
Last active December 15, 2019 19:31
JS-Script for a report about the values of a simple field over all items of the currently selected collection in Zotero or your whole Zotero library
/*
Change the constant 'field' to any simple Zotero field
(see https://api.zotero.org/itemFields?pprint=1 for a list)
and run the script as async funtion to see a report
of the currently selected collection or your complete
library. [License: CC0]
*/
const field = "language";
var collection = ZoteroPane.getSelectedCollection();
@zuphilip
zuphilip / Dockerfile
Last active November 30, 2019 16:36
Jupyter notebook for anystyle
FROM rubydata/datascience-notebook:c9ca70040856
ENV TAG=c9ca70040856
COPY . .
@zuphilip
zuphilip / README.md
Last active September 8, 2021 00:29
Tesseract IPython Notebook

Binder

@zuphilip
zuphilip / zotero-code.js
Last active November 20, 2019 22:47
Update Zotero author information from Crossref (proof of concept script)
// can be run within Zotero "Run Javascript" tool
var items = Zotero.getActiveZoteroPane().getSelectedItems();
var output
for (let item of items) {
let doi = item.getField("DOI");
if (doi) {
await Zotero.HTTP.doGet("http://api.crossref.org/works/" + doi, function (obj) {
let data = JSON.parse(obj.responseText);
for (let i = 0; i < data.message.author.length; i++) {
let crossrefAuthor = data.message.author[i];
@zuphilip
zuphilip / errors-and-warnings
Created October 23, 2019 20:25
Zotero Web Library (Beta)
Content Security Policy: Die Direktive 'child-src' sollte nicht mehr verwendet werden. Bitte verwenden Sie stattdessen die Direktive 'worker-src' zum Kontrollieren von Workern bzw. die Direktive 'frame-src' zum Kontrollieren von Frames.
Content Security Policy: Die Einstellungen der Seite haben das Laden einer Ressource auf eval blockiert ("script-src").
Content Security Policy: Die Einstellungen der Seite haben das Laden einer Ressource auf inline blockiert ("script-src"). library:1:1
Diese Website verwendet anscheinend einen scroll-verknüpften Positionierungseffekt. Dies könnte mit asynchronem Verschieben (Panning) schlecht zusammenspielen; siehe https://developer.mozilla.org/docs/Mozilla/Performance/ScrollLinkedEffects für weitere Details und nehmen Sie an der Diskussion über damit verbundene Werkzeuge und Funktionen teil! library
@zuphilip
zuphilip / zoter-bibliography-by-year.js
Last active August 25, 2020 17:31
Output selected items as a bibliography by year or tag
var items = Zotero.getActiveZoteroPane().getSelectedItems();
var qc = Zotero.QuickCopy;
var format = Zotero.Prefs.get("export.quickCopy.setting");
if (format.split("=")[0] !== "bibliography") {
//return "No bibliography style is choosen in the settings for QuickCopy and therefore stop here.";
await Zotero.Schema.schemeUpdatePromise;
var styles = Zotero.Styles.getVisible();
format = "bibliography=" + styles[0].styleID;
}
@zuphilip
zuphilip / citation.ris
Created July 14, 2019 09:25
Example of RIS file from HeinOnline
A1 Dykes, Mark W.
RT Journal Article
T1 Occurrences, Accidents, and Expectations: A Primer of These (and Some Other) Insurance-Law Concepts
JF Utah Law Review
JO Utah L. Rev.
DA 2003
Y1 2003
YR 2003
VO 2003
IS 3
@zuphilip
zuphilip / oai11.json
Created June 16, 2019 18:22
Information of OAI11 for giggity
{
"version": 2019061600,
"url": "https://indico.cern.ch/export/event/786048.ics?detail=contributions",
"title": "OAI11",
"start": "2019-06-19",
"end": "2019-06-21",
"metadata": {
"icon": "https://pbs.twimg.com/profile_images/1100377630992486405/M1ms2_Nl_200x200.png",
"links": [
{
@zuphilip
zuphilip / terminal-session
Last active March 10, 2019 22:00
Example to extract bibliographic data from Wikidata with Zotero translation-server
me@home MINGW64 ~/Coding/translation-server (master)
$ curl -d https://www.wikidata.org/wiki/Q30000000 -H 'Content-Type: text/plain' http://127.0.0.1:1969/web > wdata.json
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 823 100 784 100 39 157 7 0:00:05 0:00:04 0:00:01 197
me@home MINGW64 ~/Coding/translation-server (master)
$ curl -d @wdata.json -H 'Content-Type: application/json' http://127.0.0.1:1969/export?format=bibtex
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
@zuphilip
zuphilip / DEMO Food Quality - A Global Challenge.ctv6
Created August 26, 2018 11:02
Citavi 6 XML aus Sicherungskopie entzippt
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="utf-8"?>
<CitaviExchangeData Version="6.1.0.0" ConnectionIdentifier="C:\Users\d\Documents\Citavi 6\Projects\DEMO Food Quality - A Global Challenge\DEMO Food Quality - A Global Challenge.ctv6" Changeset="308">
<ProjectSettings>
<ActiveBibliographyGroupingSetId>3fd639be-b386-4b15-879c-70b58773bb4c</ActiveBibliographyGroupingSetId>
<AttachmentsFolderPath></AttachmentsFolderPath>
<BibliographyGroupingSets>
<BibliographyGroupingSet id="3fd639be-b386-4b15-879c-70b58773bb4c">
<Groupings>
<BibliographyGrouping>
<CaptionType>Auto</CaptionType>