Skip to content

Instantly share code, notes, and snippets.

View Melkor333's full-sized avatar
☁️
Just ping again when i don't respond. :-)

Samuel Hierholzer Melkor333

☁️
Just ping again when i don't respond. :-)
View GitHub Profile
@Melkor333
Melkor333 / highlighter.go
Last active October 24, 2025 13:29
Example Golang Syntax Highlighter with Tree-Sitter using Terminal escapes for coloring
package main
import (
"context"
_ "embed"
"fmt"
tree_sitter "github.com/tree-sitter/go-tree-sitter"
tree_sitter_javascript "github.com/tree-sitter/tree-sitter-javascript/bindings/go"
highlight "go.gopad.dev/go-tree-sitter-highlight"
"log"
{
"basics": {
"name": "Samuel Hierholzer-Ruprecht",
"label": "System Engineer, Programmer by trade",
"image": "/img/me_small.jpg",
"email": "samuel@ton-kunst.ch",
"url": "https://yosemitesam.ch",
"summary": "I'm an open source enthusiast with a big love for declarative approaches. I also love to tinker with my system and play around with minimal power user software (tiling wm, emacs, [n]vim, etc.).",
"location": {
"city": "Winterthur",
@Melkor333
Melkor333 / nix-snippets.oil
Created August 4, 2022 05:02
Nix-snippets Oil script
#!/usr/bin/env oil
### TODO: Maybe define a Nix-Snippet standard and allow other snippet sources (from github & co)
setglobal SOURCES = [ './snippets' ]
setglobal DESTINATION = '/etc/nixos/snippets'
setglobal SUDO = 'sudo'
proc askVariables (snippet) {
### For each ${x} in the snippet, ask if the variable should be replaced by something (and by what)
echo