Skip to content

Instantly share code, notes, and snippets.

@woctezuma
woctezuma / download_library_items.py
Last active May 4, 2024 21:06
Fetch a user's libary from EGS
import json
from pathlib import Path
import requests
BASE_URL = (
"https://library-service.live.use1a.on.epicgames.com/library/api/public/items"
)
STATIC_PARAMS = "includeMetadata=true"
OUTPUT_FNAME = "library-items.json"
@woctezuma
woctezuma / softwares.md
Last active May 4, 2024 13:10
Softwares

Web Browsers

  • [Firefox][firefox]✨
    • about:config -> browser.cache.disk.smart_size.enabled : false
    • [uBlock Origin][firefox-adblock]✨
    • [SteamDB][firefox-steamdb]✨
    • [Augmented Steam][firefox-augmented-steam]✨
    • [Translate Web Pages][firefox-translate]
    • [Firefox Multi-Account Containers][firefox-containers]
    • [PopUpOFF][firefox-popup-off]
  • [TunnelBear VPN][firefox-tunnelbear]
@woctezuma
woctezuma / .pre-commit-config.yaml
Last active May 4, 2024 13:07
Config for pre-commit hooks
files: \.(py|json)$
default_stages: [commit, manual]
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
hooks:
- id: ruff
args:
[
--fix,
@woctezuma
woctezuma / jpg_to_pdf.md
Last active April 25, 2024 11:53
JPG to PDF

Get pretrained weights:

wget https://dl.fbaipublicfiles.com/detr/detr-r50-e632da11.pth

Remove class weights

checkpoint = torch.load("detr-r50-e632da11.pth", map_location='cpu')
del checkpoint["model"]["class_embed.weight"]
del checkpoint["model"]["class_embed.bias"]
torch.save(checkpoint,"detr-r50_no-class-head.pth")
@woctezuma
woctezuma / inspect_profiles.py
Last active April 25, 2024 10:01
Look for words in Discord profiles (pronouns and bio)
import json
from pathlib import Path
BIO_FIELD = ["bio"]
PRONOUNS_FIELD = ["pronouns"]
fname = "profiles.json"
with Path(fname).open() as fn:
d = json.load(fn)
@woctezuma
woctezuma / download_publisher_index.py
Created April 25, 2024 09:57
Fetch the publisher index from EGS
import json
from pathlib import Path
import requests
BASE_URL = "https://egs-platform-service.store.epicgames.com/api/v1/egs/publisher-index"
OUTPUT_FNAME = "publisher-index.json"
LOCALE = "fr"
STORE_ID = "EGS"
@woctezuma
woctezuma / publisher-index.json
Created April 25, 2024 09:56
The publisher index at EGS
[
{
"contact": null,
"offers": [
{
"id": "3ceadb8101fb4950a9de85b31ed12f29",
"namespace": "188fb42582e24d20b0a876ed817efd69",
"title": "SOULVARS"
}
],
@woctezuma
woctezuma / intersect_owned_and_ignored.py
Created April 22, 2024 14:42
Check if an owned app is ignored
import json
from pathlib import Path
# https://store.steampowered.com/dynamicstore/userdata/
fname = "store.steampowered.com.json"
with Path(fname).open() as f:
data = json.load(f)
owned_apps = data["rgOwnedApps"]
@woctezuma
woctezuma / hidden_gems_using_players.md
Last active April 17, 2024 15:06
Hidden Gems, using players total (forever) as a popularity measure

This post contains a ranking of Steam games, based on a score intended to favor "hidden gems". A "hidden gem" is defined as a high-quality game (hence the "gem") which only got little attention (hence "hidden"). Therefore, the score of a game is defined as the product of a quality measure (its Wilson score) and a decreasing function of a popularity measure (its players total forever). The quality measure comes from SteamDB and the popularity measure comes from SteamSpy API. Finally, here is a reference to the NeoGAF post explaining the method, and the NeoGAF post explaining the idea behind the optimization of the only free parameter. The Python source code can be found on Github.

Reproducibility

To reproduce the results, use data downloaded betwe