Skip to content

Instantly share code, notes, and snippets.

devdave /
Created April 7, 2023 16:14
print portal names for valheim
1. Download & install Python, be sure to click option for it to be added to the system Path
2. Save this to Desktop or somewhere/anywhere
3. Find the file path to your valheim world db file.
4. Put the file path in between the quotes on line 23 / test_file
5. Using the command line, run `python`
def portals(dbfile):
with open(dbfile, 'rb') as db:
devdave / main.reds
Created March 8, 2023 14:58
Updated broken/cheat breach mini game for Cyberpunk 2077
View main.reds
//Breach protocol simplifier
//Copy to r6/scripts/breach/ make sure to create "breach" directory if it doesn't exist
// 1.6 compat
protected func OnProcessRule(out size: Uint32, out grid: array<array<GridCell>>) -> Bool {
let atStart: Bool;
let combinedPowerLevel: Float;
let extraDifficulty: Float;
let i: Int32;
devdave /
Created February 4, 2023 21:46
A short snippet to seek through a valheim db file and retrieve a lit of portals
# sourced from
import mmap
def portals(dbfile):
db = open(dbfile, 'rb')
mm = mmap.mmap(db.fileno(), 0, prot=mmap.PROT_READ)
i, l = 0, set()
while True:
devdave /
Created December 1, 2022 21:44 — forked from nealrs/
Expand common (and some very uncommon) english contractions
this code is not mine! i shamelessly copied it from
all credits go to alko and arturomp @ stack overflow.
basically, it's a big find/replace.
import re
cList = {
"ain't": "am not",
devdave /
Created December 1, 2022 18:42
simple script to summarize the contents of a directory of docx files
from pathlib import Path
from collections import Counter
from docx import Document # pip install python-docx
from nltk.tokenize import sent_tokenize, word_tokenize # pip install nltk==3.5
ROOT = Path(r"C:\\REDACTED\\book\\")
devdave /
Created November 15, 2022 16:14 — forked from samuelcolvin/
An incomplete list of people in the Python community to follow on Twitter and Mastodon.

Python People

An incomplete list of people in the Python community to follow on Twitter and Mastodon.

With the risk that Twitter dies, I'd be sad to lose links to interesting people in the community, hence this list.

I would love you to comment below with links to people I've missed.

More context and comments at the end of the list.

devdave / Speech Recognition.ahk
Created June 30, 2022 16:34 — forked from Uberi/Speech Recognition.ahk
Speech recognition with Microsoft's SAPI. A simple SpeechRecognizer class provides a quick and easy way to use speech recognition in your scripts. Inspired by some [prototype code]( made a long time ago.
View Speech Recognition.ahk
#Warn All
#Warn LocalSameAsGlobal, Off
Speech Recognition
A class providing access to Microsoft's SAPI. Requires the SAPI SDK.
devdave /
Created May 29, 2022 19:30 — forked from DarinM223/
Rust concept explanations

My explanation of the main concepts in Rust

There are three main concepts with Rust:

  1. Ownership (only one variable "owns" the data at one time, and the owner is in charge of deallocating)
  2. Borrowing (you can borrow a reference to an owned variable)
  3. Lifetimes (all data keeps track of when it will be destroyed)

These are fairly simple concepts, but they are often counter-intuitive to concepts in other languages, so I wanted to give a shot at

devdave / nde_winamp_format.txt
Created April 22, 2022 19:07
Winamp media library NDE (Nullsoft Database Engine) format
View nde_winamp_format.txt
Nullsoft Database Engine Format Specifications v1.0
1. Tables
devdave / gist:86caf21b18e2a9c35ad451bf4e3ff762
Created September 4, 2021 03:44 — forked from hest/gist:8798884
Fast SQLAlchemy counting (avoid query.count() subquery)
View gist:86caf21b18e2a9c35ad451bf4e3ff762
def get_count(q):
count_q = q.statement.with_only_columns([func.count()]).order_by(None)
count = q.session.execute(count_q).scalar()
return count
q = session.query(TestModel).filter(...).order_by(...)
# Slow: SELECT COUNT(*) FROM (SELECT ... FROM TestModel WHERE ...) ...
print q.count()