Skip to content

Instantly share code, notes, and snippets.

View KalebNyquist's full-sized avatar

Kaleb Nyquist KalebNyquist

View GitHub Profile
@KalebNyquist
KalebNyquist / lookupZoteroCollections.js
Created August 8, 2021 21:44
One of my frustrations with Zotero is that there is no easy way to list all the collections in which a file is stored. This is my band-aid of a solution. The code can be run under Tools > Developer > Run Javascript using "Sync" mode.
// Instructions:
// (1) Highlight file of interest.
// (2) Run code in Zotero's JavaScript console (found under Tools > Developer > Run Javascript) in sync mode.
function collections_output() {
zp = Zotero.getActiveZoteroPane()
items = zp.getSelectedItems()
collection_ids = items[0]["_collections"]
collections_cache = Zotero.Collections._objectCache
@KalebNyquist
KalebNyquist / fav_palettes.py
Created June 19, 2022 05:20
Favorite Palettes
# Some of my favorite color palettes, including the original sources and the code I used to customize them to my liking
# Used as reference: http://tsitsul.in/img/colors/all_palettes/tableau.20.colorblind.png | http://tsitsul.in/blog/coloropt/
xgfs_normal11 = [(235, 172, 35), (184, 0, 88), (0, 140, 249), (0, 110, 0), (0, 187, 173), (209, 99, 230), (178, 69, 2), (255, 146, 135), (89, 84, 214), (0, 198, 248), (135, 133, 0), (0, 167, 108)]
xgfs_greys = [(88, 88, 88), (238, 238, 238)]
tableau_18 = [[ 31, 119, 180], [174, 199, 232], [255, 127, 14], [255, 187, 120], [ 44, 160, 44], [152, 223, 138], [214, 39, 40], [255, 152, 150], [148, 103, 189], [197, 176, 213], [140, 86, 75], [196, 156, 148], [227, 119, 194], [247, 182, 210], [188, 189, 34], [219, 219, 141], [ 23, 190, 207], [158, 218, 229]]
tableau_grey = [[127, 127, 127], [199, 199, 199]]
# Convert to Hex
from matplotlib import colors
@KalebNyquist
KalebNyquist / spec.json
Created September 20, 2022 03:41
Vega-Lite spec from Mon Sep 19 2022
{
"config": {
"view": {
"continuousWidth": 400,
"continuousHeight": 400,
"strokeWidth": 0,
"stroke": "#000000"
}
},
"layer": [
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.