Skip to content

Instantly share code, notes, and snippets.

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': ''}
ET.register_namespace('', namespaces['csl'])
inline = ET.parse(sys.argv[1])
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="" class="in-text" version="1.0" demote-non-dropping-particle="never" page-range-format="expanded">
<!-- This style was edited with the Visual CSL Editor ( -->
<title>Zotero Citation Columns</title>
<!-- link href="" rel="self"/>
<link href="" rel="documentation"/ -->
<name>Brenton M. Wiernik</name>
View gist:28460e68156b89b82e6cc00e1792adde
This file has been truncated, but you can view the full file.
PRAGMA foreign_keys=OFF;
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);
View CSV.js
"translatorID": "25f4c5e2-d790-4daa-a667-797619c7e2f2",
"label": "CSV",
"creator": "Philipp Zumstein and Aurimas Vinckevicius",
"target": "csv",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
"displayOptions": {
"exportCharset": "UTF-8xBOM",
#!/usr/bin/env python3
import scrapy
from scrapy.pipelines.files import FilesPipeline
from scrapy.exceptions import CloseSpider
import sys
import os
ITEM_PIPELINES = {'SoundZipPipeline': 1}
View mnras.bib
\newcommand{\mnras}{Monthly Notices of the Royal Astronomical Society}
author = {{Howard}, A.~D.~P. and {Whitworth}, A.~P. and {Marsh}, K.~A. and {Clarke}, S.~D. and {Griffin}, M.~J. and {Smith}, M.~W.~L. and {Lomax}, O.~D.},
title = "{L1495 revisited: a PPMAP view of a star-forming filament}",
journal = {\mnras},
keywords = {stars: formation, dust, extinction, ISM: structure, submillimetre: ISM, Astrophysics - Astrophysics of Galaxies},
year = 2019,
View putout-new-line-plugin.js
module.exports.fix = (path) => {
path.node.value.raw = '\n';
module.exports.traverse = ({push}) => ({
TemplateLiteral(path) {
const [start] = path.node.quasis;
if (/^\n\s+/.test(start.value.raw))
View source.js
export function set(extra) {
extra += `
${prefix}${casing[field] || field}
${value.raw ? "=" : ":"}
return extra;