Skip to content

Instantly share code, notes, and snippets.

View Arcanemagus's full-sized avatar

Landon Abney Arcanemagus

  • Oregon State University
View GitHub Profile
@Aerijo
Aerijo / tree_sitter_guide.md
Last active July 24, 2025 02:08
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.

@JonnyWong16
JonnyWong16 / update_history_grouping.py
Last active October 17, 2018 19:44
Updates history grouping in the Tautulli database with the new logic on v2.1.12.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Updates history grouping in the Tautulli database with the new logic on v2.1.12.
# Author: /u/SwiftPanda16
# Requires: requests
import requests
### EDIT SETTINGS ###
@JonnyWong16
JonnyWong16 / plex_discord_rpc.py
Last active May 26, 2023 03:01
Discord Rich Presence for Plex
import asyncio
import json
import os
import struct
import sys
import time
from plexapi.myplex import MyPlexAccount
### EDIT SETTINGS ###
#!/usr/local/bin/python2.7
import os
import sys
import json
import requests
webhook_id = "foo"
webhook_token = "bar"
@JonnyWong16
JonnyWong16 / update_all_metadata.py
Last active June 27, 2025 03:41
Updates all metadata in the Tautulli database after moving Plex libraries.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Updates all metadata in the Tautulli database after moving Plex libraries.
# Author: /u/SwiftPanda16
# Requires: plexapi, requests
from plexapi.server import PlexServer
import requests
@Arcanemagus
Arcanemagus / apm-publish.ps1
Last active June 12, 2019 18:35
Commit staged changes and publish to APM
Param(
[Parameter(Position=0, Mandatory)]
[String]
$version = ""
)
Function Exec
{
[CmdletBinding()]
param (
@Arcanemagus
Arcanemagus / npm-update-children.ps1
Last active January 20, 2019 09:21
Runs npm prune + dedupe + update on all subdirectories that have a package.json
function Exec
{
[CmdletBinding()]
param (
[Parameter(Position=0, Mandatory=1)]
[scriptblock]$Command,
[Parameter(Position=1, Mandatory=0)]
[string]$ErrorMessage = "Execution of command failed.`n$Command"
)
& $Command