Skip to content

Instantly share code, notes, and snippets.

View doc22940's full-sized avatar

Acampbell doc22940

View GitHub Profile
@viridiano
viridiano / researchtoolbox.md
Last active March 21, 2024 12:20
Researchers Toolbox – Tools for grad students and researchers

AWESOME LINGUISTICS - A curated list of anything remotely related to linguistics, sorted in alphabetical order. Awesome

Getting Started with Coding for Humanities Scholars (Python)

NOTE: The Programming Historian contains many coding lessons gea

@simonbs
simonbs / Import Shortcut Links.js
Created September 21, 2019 11:37
Reads a text file containing iCloud links to shortcuts and imports the shortcuts into the Shortcuts app
@CTimmerman
CTimmerman / Flask_CRUD_demo.py
Last active May 9, 2022 10:00
Flask CRUD demo
# pylint: disable=broad-except, invalid-name, redefined-builtin
"""CRUD API demo in Python with Flask.
2019-08-29 https://blog.rapidapi.com/how-to-build-an-api-in-python/ simplified by Cees Timmerman.
2022-05-09 Polished.
"""
import random
from flask import Flask, request
@simonbs
simonbs / Append to File.js
Created August 27, 2019 20:31
Appends text to a file. To be used with Shortcuts.
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-blue; icon-glyph: file-signature;
let text = args.shortcutParameter
let fm = FileManager.iCloud()
let filePath = args.fileURLs[0]
let content = fm.readString(filePath)
let newText = content + "\n" + text
fm.writeString(filePath, newText)
Script.complete()
@simonbs
simonbs / List Tags.js
Last active April 18, 2020 10:52
Lists unique tags across multiple files. To be used with Shortcuts.
let fm = FileManager.iCloud()
let filePaths = args.fileURLs
let tags = filePaths.reduce((cur, e) => {
return cur.concat(fm.allTags(e))
}, [])
let uniqueTags = tags.filter((t, idx) => {
return tags.indexOf(t) === idx
})
let output = {"tags": uniqueTags}
Script.setShortcutOutput(output)
@simonbs
simonbs / Remove Tag.js
Last active April 18, 2020 10:52
Removes a tag from a file. To be used with Shortcuts.
let tag = args.shortcutParameter
let fm = FileManager.iCloud()
let filePath = args.fileURLs[0]
fm.removeTag(filePath, tag)
let tags = fm.allTags(filePath)
let output = {"tags": tags}
Script.setShortcutOutput(output)
Script.complete()
@simonbs
simonbs / Add Tag.js
Last active April 18, 2020 10:52
Adds a tag to a file. To be used with Shortcuts.
let tag = args.shortcutParameter
let fm = FileManager.iCloud()
let filePath = args.fileURLs[0]
fm.addTag(filePath, tag)
let tags = fm.allTags(filePath)
let output = {"tags": tags}
Script.setShortcutOutput(output)
Script.complete()
@sdurandeu
sdurandeu / OnlineToolsSites.md
Last active January 20, 2023 23:00
Online Tools and Sites
@paulirish
paulirish / asciiify-the-canvas.js
Last active January 4, 2025 15:03
ascii rendering of a canvas
// works great on about:dino
// 1. save this file to your snippets.
// 2. load about:dino
// 3. evaluate the snippet
// 4. hit up arrow to trigger the game.
// 5. profit
(function() {
perfnow = performance.now;
@simonbs
simonbs / Create Gist.js
Last active May 20, 2025 07:10
Scriptable script for creating a gist.
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: brown; icon-glyph: file-code;
// To use this script, you need to configure an OAuth App on GitHub.
// Follow the instructions on the link below to create your OAuth App.
//
// When you are asked to put in a redirect URL, you should put the URL for running this script in Scriptable. Assuming the name of this script is "Create Gist", the URL is scriptable:///run?scriptName=Create%20Gist
//
// https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/
//