Skip to content

Instantly share code, notes, and snippets.

View zverhope's full-sized avatar

Zachary Verleyen-Hope zverhope

View GitHub Profile
const execSync = require('child_process').execSync;
const spawnSync = require('child_process').spawnSync;
async function compile(input, context) {
// This is undocumented and could break.
let basePath = context.app.vault.adapter.basePath;
if (!basePath.endsWith("/")) {
basePath = basePath + "/";
}
@FeralFlora
FeralFlora / kanban-maker-quickadd.js
Last active August 21, 2024 06:52
A Kanban generating script that uses tags to merge Zotero items into lists of a Kanban board in Obsidian, and updates the reading statuses of items in the process 🚀 Setup and usage guide: https://share.note.sx/e612da498b038c3e5e367043782e2b59 Need support? Head to https://discord.com/channels/686053708261228577/1176414557900648541 or comment below.
/*
* Zotero Kanban Reading List by FeralFlora // https://github.com/FeralFlora/
* Version 1.6.1
* Setup and usage guide at: https://share.note.sx/e612da498b038c3e5e367043782e2b59
* Support at: https://discord.com/channels/686053708261228577/1176414557900648541
*/
const fs = require('fs');
const KANBAN_PATH = "Kanban board file path";
const BIBLIOGRAPHY_PATH = "Bibliography file path";
@Heziode
Heziode / dataviewjs_wordcount_obsidian.js
Created April 8, 2023 14:47
Word and Character Count of multiple notes in Obsidian, using dataviewjs.
// Word Count Dashboard
// a dataviewjs snippet by @pseudometa, https://gist.github.com/chrisgrieser/ac16a80cdd9e8e0e84606cc24e35ad99
// version 1.10.2
// last update: 2022-01-25
//----------------------------------------------------
// Import configuration
//----------------------------------------------------
const source = dv.current();
const sourceFolder = source.sourceFolder;
#!/usr/bin/env bash
# ~/.osx — https://mths.be/osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@florido
florido / Pinboard.scpt
Created April 30, 2019 23:06 — forked from itst/Pinboard.scpt
Import and update your Pinboard bookmarks to DEVONthink
(* Import and update your Pinboard bookmarks to DEVONthink
Based on work done by Christian Grunenberg on Mon Jan 23 2006,
Rafael Bugajewski to support Pinboard instead of Delicious on Sun Dec 19 2010 and
Andreas Zeitler on Sun Mar 03 2011 to display user feedback when finished.
By Sascha A. Carlin <https://sascha.carlin.de/> on 2018-03-07 to set the creation date of new record, show progress bar, use Pinboard Auth Token, use modification date of folder to fetch only recent items
Copyright (c) 2018. All rights reserved. *)
use framework "Foundation"
@derickfay
derickfay / sk2c single note templated.applescript
Created March 9, 2019 23:49
Export selected Skim notes to the clipboard using native Skim templates
(* EXPORT SELECTED NOTES TO THE CLIPBOARD
(no longer) requires hackademic URL handler from github user smargh
entirely rewritten to take advantage of Skim's built-in templating
2019-03-10 by derickfay
*)
property LF : (ASCII character 10)
@ccstone
ccstone / Raw_AppleScript_Event_Codes_2006.tsv
Last active August 17, 2024 08:17
Raw AppleScript Event Codes (2006)
Code Terminology Kind Usage Line
$scr scripting additions folder Property of class: domain System Events : Disk-Folder-File Suite 1
%doc music folder Property of class: user domain object System Events : Disk-Folder-File Suite 2
µdoc music folder Enumeration Standard Additions : File Commands 3
ƒhlp help Enumeration Standard Additions : File Commands 4
ƒhlp help folder Enumeration Standard Additions : File Commands 5
ƒlib shared libraries Enumeration Standard Additions : File Commands 6
ƒlib shared libraries folder Enumeration Standard Additions : File Commands 7
ƒmod modem scripts Enumeration Standard Additions : File Commands 8
ƒmod modem scripts folder Enumeration Standard Additions : File Commands 9
@derickfay
derickfay / btt-skim.json
Last active October 1, 2020 19:49
Skim Touch Bar preset
[
{
"BTTTouchBarButtonName" : "P",
"BTTTriggerType" : 629,
"BTTTriggerClass" : "BTTTriggerTypeTouchBar",
"BTTPredefinedActionType" : 172,
"BTTPredefinedActionName" : "Run Apple Script (blocking)",
"BTTInlineAppleScript" : "tell application \"BetterTouchTool\"\r\t(* light purple *)\r\tupdate_trigger \"625CCE43-9BF7-403E-8AEF-331CA96BBD0E\" json \"{\\\"BTTTriggerConfig\\\":{\\\"BTTTouchBarButtonColor\\\" : \\\"204,102,255,100\\\"}}\"\r\t(* dim yellow *)\r\tupdate_trigger \"701399EC-B8BF-472D-8A2E-4F9FB5F01F75\" json \"{\\\"BTTTriggerConfig\\\":{\\\"BTTTouchBarButtonColor\\\" : \\\"0,0,0,20\\\"}}\"\r\t(* dim green *)\r\tupdate_trigger \"E395E5B6-E655-47EA-BDD1-F6BE0086BE3B\" json \"{\\\"BTTTriggerConfig\\\":{\\\"BTTTouchBarButtonColor\\\" : \\\"0,0,0,20\\\"}}\"\r\t(* dim text selection *)\r\tupdate_trigger \"E5BDF354-1D20-414A-A7B8-A2861F299A3B\" json \"{\\\"BTTTriggerConfig\\\":{\\\"BTTTouchBarButtonColor\\\" : \\\"0,0,0,20\\\"}}\"\r\t(* dim underline *)\r\tupdate_trigger \"EC62F039-63
@RobTrew
RobTrew / BBDrafts.js
Last active January 17, 2023 16:45
First draft of (Drafts 5 - based) JS (JXA) interface functions for BBEDIT
// A draft JXA library which aims to provide macOS BBEdit
// (https://www.barebones.com/products/bbedit/)
//
// with some of the iOS Drafts 5 (http://getdrafts.com/)
// editor functions.
// Save this file as '~/Library/Script Libraries/BBDrafts.js'
// Rob Trew (c) 2018
# Touch, make executable and start editing a new script
# $ newscript my_new_script.sh
# edit default shebangs within the function
# include additional skeleton files as [extension].txt
# in the $defaults_txt folder defined in config
newscript() {
# Config
# where your scripts are stored
local scriptdir=~/scripts/
# if no extension is provided, default to