Skip to content

Instantly share code, notes, and snippets.

@theomichel
theomichel / backlinks.js
Last active July 14, 2022 04:53
This script attempts to automatically create back-links for an Airtable linked record that references the same table.
@on2air
on2air / same-table-backlinks.js
Last active May 20, 2023 08:49
Same Table Backlinks
@ZicklePop
ZicklePop / unpkg.js
Last active December 9, 2023 05:21
unpkg importer for scriptable.app, downloads modules to `iCloud Drive/Scriptable/modules`
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: green; icon-glyph: archive;
// unpkg: like NPM but not as good
// and available in Scriptable
//
// Examples:
// - const _ = await unpkg('lodash')
// - const CryptoJS = await unpkg('crypto-js')
// - const OAuth = await unpkg('oauth-1.0a')
@hwangbible
hwangbible / example.js
Last active December 6, 2023 21:59
Scriptablify - lets you require('modules') in Scriptable app!
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: gray; icon-glyph: magic;
// Defaults to the latest version and no automatic update; if the file exists, just use it
const moment = await require('moment');
// Use any SemVer options to specify a version you want
// Refer to the calculator here: https://semver.npmjs.com/
const lodash = await require('lodash@^3.9.1');
@schl3ck
schl3ck / AppWatcher.js
Last active February 29, 2024 07:28
iOS Scriptable script to track the price and in-app purchases of your favourite apps
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: blue; icon-glyph: laptop-code;
// share-sheet-inputs: url;
/*******************************************
* *
* /\ *
* / \ _ __ _ __ *
* / /\ \ | '_ \| '_ \ *
* / ____ \| |_) | |_) | *
@Aerijo
Aerijo / tree_sitter_guide.md
Last active March 30, 2024 15:19
Guide to writing your first Tree-sitter grammar

Guide to your first Tree-sitter grammar

NOTE: The Tree-sitter API and documentation has changed and improved since this guide was created. I can't guarantee this is up to date.

About

Tree-sitter is the new way Atom is providing language recognition features, such as syntax highlighting, code folding, autocomplete, and more. In contrast to TextMate grammars, which work by regex matching, Tree-sitter will generate an entire syntax tree. But more on that can be found in it's own docs.

Here, we look at making one from scratch.

@ericbn
ericbn / .vimrc
Last active March 31, 2024 10:39
Vim Powerline-like status line without the need of any plugin
" Statusline (requires Powerline font)
set statusline=
set statusline+=%(%{&buflisted?bufnr('%'):''}\ \ %)
set statusline+=%< " Truncate line here
set statusline+=%f\ " File path, as typed or relative to current directory
set statusline+=%{&modified?'+\ ':''}
set statusline+=%{&readonly?'\ ':''}
set statusline+=%= " Separation point between left and right aligned items
set statusline+=\ %{&filetype!=#''?&filetype:'none'}
set statusline+=%(\ %{(&bomb\|\|&fileencoding!~#'^$\\\|utf-8'?'\ '.&fileencoding.(&bomb?'-bom':''):'')
@eaigner
eaigner / JSONConvertible.swift
Created April 9, 2016 15:13
Convert Objects to and from JSON
import Foundation
protocol JSONConvertible {
}
extension JSONConvertible {
func toJSON() -> [String: AnyObject] {
var json = [String: AnyObject]()
@JMichaelTX
JMichaelTX / JXA Resources.md
Last active March 31, 2024 04:38
JavaScript for Automation (JXA) Resources

JXA Resources

Revised: 2019-11-28 16:16 GMT-6

JXA

This is a list of the key resources I have found useful. If you know of others, please post in a comment below, and I will add to this list.

I have tried to order this list in the order that, to me, is best for learning JXA from scratch. We all learn a bit diferently, so adjust to suit your style/needs. Please post if you have suggestions on learning JXA.

@RobTrew
RobTrew / JXA_PersistentProperties.js
Last active January 30, 2024 09:07
Persistent 'properties' for OS X JavaScript for Applications (JXA)
(function () {
'use strict';
// OSX JavaScript for Applications lacks the persistent 'properties'
// of AppleScript (in which global variables and properties persist between script runs)
// but we can, of course, serialise to JSON or plist at the end of a script
// parsing it at the start of the next run.
// Here is one approach to persistence between script runs
// using JSON.stringify() and JSON.parse()