Skip to content

Instantly share code, notes, and snippets.

@VyrCossont
VyrCossont / mastodon-advanced-search.md
Last active January 27, 2023 03:43
filter by users and sort by date in Mastodon. see https://demon.social/@vyr/109296080568061011

new search features

  • setting SEARCH_ALL_VISIBLE_TOOTS=true in your instance config will let users search all non-private posts, not just the ones they've interacted with.
  • prefixing a search query with 🔍 will use ES simple query string syntax instead of Mastodon's weird broken subset of it, which will let you use "double quotes" for literal strings including white space, + to force a term to be included, or - to force a term to be excluded.
  • prefixing a search query with 🔎 will use ES regular query string syntax which is like simple query syntax, except:
    • syntax errors will cause the search to fail, so if you don't get anything back, that's why.
  • you can specify individual fields to match on. if you don't specify a field for a given search term, it does a normal full-text search for
@myobie
myobie / service-worker.ts
Last active September 12, 2025 18:29
A small example of a service worker in typescript along with the tsconfig.json that allows tsserver and IDEs to understand what's going on
// NOTE: We must export or import at least one thing so we are not in
// the "global" scope, but in a module scope which is re-declarable.
//
// The error from tsserver is: 2451: Cannot redeclare block-scoped
// variable 'self'.
//
// Even tho this is not really a module and cannot be: ServiceWorkers
// cannot be modules.
export type Version = number
@schwarzeni
schwarzeni / util.go
Last active February 24, 2025 02:57
[golang] get specific network interface's IPv4 address
package util
import (
"errors"
"fmt"
"net"
)
// useful links:
// https://stackoverflow.com/questions/27410764/dial-with-a-specific-address-interface-golang
@ptrv
ptrv / spatialite_example.go
Last active September 8, 2022 02:48
SpatiaLite example in Go
package main
import (
"database/sql"
"github.com/mattn/go-sqlite3"
"log"
"os"
)
func runQuery(db *sql.DB, query string) {