Skip to content

Instantly share code, notes, and snippets.

View bwiernik's full-sized avatar

Brenton M. Wiernik bwiernik

View GitHub Profile
@bwiernik
bwiernik / gist:d6e9ec536d0b88c439b1
Created April 17, 2015 17:26
Web of Science "Citing references" translator records output
12:11:25 [
"0": [object HTMLDivElement] {
"align": ""
"click": function click() { [native code] }
"focus": function focus() { [native code] }
"blur": function blur() { [native code] }
"title": ""
"lang": ""
"dir": ""
"dataset": [object DOMStringMap] <<Maximum depth reached>>
<?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">
<info>
<title>American Psychological Association 6th edition (Short Authors)</title>
<title-short>APA (Short Authors)</title-short>
<id>http://www.zotero.org/styles/apa-short-authors</id>
<link href="http://www.zotero.org/styles/apa-short-authors" rel="self"/>
<link href="http://owl.english.purdue.edu/owl/resource/560/01/" rel="documentation"/>
<author>
<name>Simon Kornblith</name>
/*
Based on batch editing script from zuphilip
How does this work?
0) make a backup copy
1) create a collection of all entries you want to randomly sample
(maybe use a smart search or drag and drop, delete individual items)
2) check that you have exactly the items you want to change in your collection
3) choose one example here and adapt it to your needs
4) run the code
@bwiernik
bwiernik / ape-numeric.csl
Created October 5, 2017 10:29
Numeric APA CSL style
<?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">
<info>
<title>American Psychological Association 6th edition (numeric)</title>
<title-short>APA (numeric)</title-short>
<id>http://www.zotero.org/styles/apa-numeric</id>
<link href="http://www.zotero.org/styles/apa-numeric" rel="self"/>
<link href="http://owl.english.purdue.edu/owl/resource/560/01/" rel="documentation"/>
<author>
<name>Simon Kornblith</name>
@bwiernik
bwiernik / antiquity-custom.csl
Created October 20, 2017 20:24
Custom citation style based on Antiquity
<?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="chicago" default-locale="en-GB">
<info>
<title>Antiquity</title>
<id>http://www.zotero.org/styles/antiquity</id>
<link href="http://www.zotero.org/styles/antiquity" rel="self"/>
<link href="http://www.zotero.org/styles/chicago-author-date" rel="template"/>
<link href="http://journal.antiquity.ac.uk/contribute" rel="documentation"/>
<author>
<name>Sebastian Karcher</name>
@bwiernik
bwiernik / RIS.js
Created December 13, 2017 07:30
Modified Zotero import translator for Endnote RIS files - import Accession Number as PMID
{
"translatorID": "32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7",
"translatorType": 3,
"label": "RIS",
"creator": "Simon Kornblith and Aurimas Vinckevicius",
"target": "ris",
"minVersion": "3.0.4",
"maxVersion": null,
"priority": 100,
"inRepository": true,
@bwiernik
bwiernik / chicago-author-date-footnotes.csl
Created December 14, 2017 15:21
Chicago CSL style - author-date in footnotes
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="note" version="1.0" demote-non-dropping-particle="display-and-sort" page-range-format="chicago">
<info>
<title>Chicago Manual of Style 17th edition (author-date in footnotes)</title>
<id>http://www.zotero.org/styles/chicago-author-date-footnotes</id>
<link href="http://www.zotero.org/styles/chicago-author-date-footnotes" rel="self"/>
<link href="http://www.chicagomanualofstyle.org/tools_citationguide.html" rel="documentation"/>
<author>
<name>Julian Onions</name>
<email>julian.onions@gmail.com</email>
@bwiernik
bwiernik / power_tau.R
Created October 25, 2019 23:32
Power function for testing τ = 0 for random effects meta-analyses
# Based on methods described by Hedges and Pigott, https://doi.org/10.1037/1082-989X.9.4.426, p. 438
# Written 2019-10-25 by Brenton M. Wiernik
# Licensed GPL v3.0
power_curve <- function(object, tau, level = .95) {
if (! inherits(object, "rma.uni")) stop("'object' must be an object of class 'rma.uni'")
tau2 <- tau^2
obs_tau2 <- object$tau2
obs_tau <- sqrt(obs_tau2)
obs_H2 <- object$H2
@bwiernik
bwiernik / apa.csl
Created December 24, 2019 16:47
APA 7th edition CSL style with medium substitution
<?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">
<info>
<title>American Psychological Association 7th edition</title>
<title-short>APA</title-short>
<id>http://www.zotero.org/styles/apa</id>
<link href="http://www.zotero.org/styles/apa" rel="self"/>
<link href="http://www.zotero.org/styles/apa-6th-edition" rel="template"/>
<link href="https://apastyle.apa.org/style-grammar-guidelines/references/examples" rel="documentation"/>
<author>
@bwiernik
bwiernik / biochemical-journal-date.csl
Created January 21, 2020 19:15
Biochemical Journal (sorted by date) CSL Style
<?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="sort-only" default-locale="en-US">
<info>
<title>Biochemical Journal (sorted by date)</title>
<id>http://www.zotero.org/styles/biochemical-journal-date</id>
<link href="http://www.zotero.org/styles/biochemical-journal-date" rel="self"/>
<link href="http://www.zotero.org/styles/biochemical-journal" rel="template"/>
<link href="http://www.biochemj.org/bj/bji2a.htm#References" rel="documentation"/>
<author>
<name>Sebastian Karcher</name>