Skip to content

Instantly share code, notes, and snippets.

View zotero.lua
do
do
local _ENV = _ENV
package.preload[ "locator" ] = function( ... ) local arg = _G.arg;
local module = {}
local labels = {
book = 'book',
['bk.'] = 'book',
View dir2rdf.py
#!/usr/bin/python
import os
import xml.etree.ElementTree as ET
import sys
try:
from urllib.parse import quote
except ImportError:
from urllib import quote
@retorquere
retorquere / merge
Created Mar 2, 2022
merge CSL styles
View merge
#!/usr/bin/env python3
import sys
from pathlib import Path
import xml.etree.ElementTree as ET
namespaces = {'csl': 'http://purl.org/net/xbiblio/csl'}
ET.register_namespace('', namespaces['csl'])
inline = ET.parse(sys.argv[1])
View File Hierarchy.js
Maintained version lives at https://github.com/retorquere/zotero-file-hierarchy
View BlaBla.js
{
"translatorID": "f4a4148e-990c-45fb-a25f-579e90dfbcd7",
"label": "BlaBla Export",
"creator": "Emiliano Heyns",
"target": "xml",
"minVersion": "5.0.0",
"maxVersion": null,
"priority": 50,
"inRepository": false,
"translatorType": 2,
View BlaBla.js
{
"translatorID": "f4a4148e-990c-45fb-a25f-579e90dfbcd7",
"label": "BlaBla Export",
"creator": "Emiliano Heyns",
"target": "xml",
"minVersion": "5.0.0",
"maxVersion": null,
"priority": 50,
"inRepository": false,
"translatorType": 2,
View zotero-cite-columns.csl
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="never" page-range-format="expanded">
<!-- This style was edited with the Visual CSL Editor (https://editor.citationstyles.org/visualEditor/) -->
<info>
<title>Zotero Citation Columns</title>
<id>http://www.zotero.org/styles/zotero-cite-columns</id>
<!-- link href="http://www.zotero.org/styles/zotero-cite-columns" rel="self"/>
<link href="https://github.com/retorquere/zotero-citation-columns" rel="documentation"/ -->
<author>
<name>Brenton M. Wiernik</name>
View multiline.py
import yaml
from collections import OrderedDict
class quoted(str):
pass
def quoted_presenter(dumper, data):
return dumper.represent_scalar('tag:yaml.org,2002:str', data, style='"')
yaml.add_representer(quoted, quoted_presenter)
View zotero.lua
do
do
local _ENV = _ENV
package.preload[ "locator" ] = function( ... ) local arg = _G.arg;
local module = {}
local labels = {
book = 'book',
['bk.'] = 'book',
View gist:28460e68156b89b82e6cc00e1792adde
This file has been truncated, but you can view the full file.
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE itemTypes ( itemTypeID INTEGER PRIMARY KEY, typeName TEXT, templateItemTypeID INT, display INT DEFAULT 1 );
INSERT INTO itemTypes VALUES(1,'note',NULL,0);
INSERT INTO itemTypes VALUES(2,'book',NULL,2);
INSERT INTO itemTypes VALUES(3,'bookSection',2,2);
INSERT INTO itemTypes VALUES(4,'journalArticle',NULL,2);
INSERT INTO itemTypes VALUES(5,'magazineArticle',NULL,2);
INSERT INTO itemTypes VALUES(6,'newspaperArticle',NULL,2);