Skip to content

Instantly share code, notes, and snippets.

View russmatney's full-sized avatar

Russell Matney russmatney

View GitHub Profile
@d6e
d6e / godot_ci_cache.py
Last active February 14, 2024 10:20
Builds the godot cache by collecting all the expected godot import paths in the *.import files, then launching godot, then waiting until it populates all the expected import paths, then stopping the godot process.
import os
import subprocess
import time
import re
from pathlib import Path
# Set the path to your Godot project and Godot executable
GODOT_PROJECT_PATH = Path("myproject")
GODOT_EXECUTABLE = "godot" # or the path to your Godot executable
GODOT_LOG_FILE = Path("artifacts") / "godot_output.log" # Log file to store Godot output
@alexander-yakushev
alexander-yakushev / aoc2023-day1.clj
Last active December 1, 2023 13:53
Advent of Code 2023, day 1
;; Didn't know yet that there is a special syntax to make regexes overlapping. Got angry and wrote this.
(require '[clojure.string :as str])
(def digits (->> ["one" "two" "three" "four" "five" "six" "seven" "eight" "nine"]
(map-indexed (fn [i w] [w (str (inc i))]))
(into {})))
(def rx (re-pattern (str/join "|" (conj (keys digits) "[0-9]"))))
(def rx-rev (re-pattern (str/join "|" (conj (map str/reverse (keys digits)) "[0-9]"))))
@mathielo
mathielo / README-SteamBots-Secrets.md
Last active April 16, 2024 11:33
Steam Bots: How to get shared and identity secrets from Steam Guard TOTP

Steam Bots: How to get shared and identity secrets

If you're looking into automating transactions in your Steam Account using Steam Bots, you most likely will need to:

  1. Have TOTP ("MFA" or "2FA") enabled via Steam Authenticator (Steam Guard)
  2. Have in hands both shared secret and identity secret

Having Steam Guard enabled for your Steam Account ensures that there will be no holds on transactions such as trades. Having the shared and identity secrets are necessary for complete autonomy of your Steam Bot, meaning it won't require any human interaction from you.

There is a tremendous lack of information about all of this as Steam does not provide official support for implementing Steam Bots. The information available in this guide was gathered through lots of blood and sweat hard research, reverse eng

@yogthos
yogthos / README.md
Last active March 24, 2024 10:35
command line util for grabbing current weather for a city using OpenWeather API

usage

Create an account at https://openweathermap.org and get an API key. Note that it can take up to a couple of hours for the key to become active. Add an environment variable OPEN_WEATHER_API_KEY with the value of the key.

run the script:

./weather.clj Toronto,CA
@simonw
simonw / README.md
Created November 5, 2022 21:03
Stream activity from Mastodon into a SQLite database

Stream Mastodon activity into a SQLite database

This script subscribes to the live HTTP feed of public activity on my Mastodon instance and writes the results into SQLite database tables.

It needs sqlite-utils and httpx:

pip install sqlite-utils httpx

Then run:

@dustingetz
dustingetz / a.md
Last active October 4, 2022 15:47
HOWTO install `#uri` reader extension in Clojure/Script
@malcolmsparks
malcolmsparks / thoughts-on-yada.adoc
Last active January 22, 2023 19:24
Thoughts on yada

Thoughts on yada

Frameworks

Let’s define a framework as any library that contains one or more functions that accept callbacks.

Web frameworks are great for beginner developers who need to get stuff done. But they ultimately force you into a corner. In most applications, experienced developers need to retain control. Libraries are better.

@borkdude
borkdude / new
Last active July 23, 2022 14:25
Create clojure project with babashka using deps-new
#!/usr/bin/env bb
(require '[babashka.classpath :as cp]
'[babashka.deps :as deps])
(deps/add-deps '{:deps {org.corfield/deps-new {:git/url "https://github.com/borkdude/deps-new"
:git/sha "76259a27c57dba4530671a3d18c610ed904297d7"}
org.babashka/cli {:mvn/version "0.3.31"}
org.babashka/spec.alpha {:git/url "https://github.com/babashka/spec.alpha"
:git/sha "1a841c4cc1d4f6dab7505a98ed2d532dd9d56b78"}}})
@jackrr
jackrr / distinct-p.clj
Created February 5, 2022 20:34
Lazily remove duplicate members of list, by predicate "hashing" function on members
(defn distinct-p
([pred coll]
(distinct-p pred coll #{}))
([pred coll seen]
(if (empty? coll)
'()
(lazy-seq
(let [next (first coll)
key (pred next)
is-dup (contains? seen key)
@IGJoshua
IGJoshua / reload.clj
Last active January 28, 2022 21:00
Reloadable function vars
(require '[clojure.spec.alpha :as s])
(s/def ::defreloadable-args
(s/cat :name simple-symbol?
:doc (s/? string?)
:attr-map (s/? map?)
:fn-tails (s/+ any?)))
(defmacro defreloadable
"Defines a new function as [[defn]], but old references will refer to new versions when reloaded.