Skip to content

Instantly share code, notes, and snippets.

View sbalnojan's full-sized avatar

Sven Balnojan sbalnojan

View GitHub Profile
@sbalnojan
sbalnojan / straight-home-privacy.md
Created September 8, 2026 12:58
Straight Home — Support & Privacy

Straight Home — Support & Privacy

Version 1.0 · Last updated 8 September 2026

Support

Straight Home is a puzzle game for iPhone. The ship only ever flies straight; you move space instead — place a wormhole, fold the map — and then launch and watch. Thirty-five levels in six galaxies, and nine laws of physics to discover along the way.

Questions, bugs, or a level that feels wrong: sven@balnojan.com. I read every mail and answer within a few days.

@sbalnojan
sbalnojan / privacy_overripe.md
Created September 8, 2026 10:37
Overripe — Support & Privacy

Overripe — Support & Privacy

Version 1.0 · Last updated 8 September 2026

Support

Overripe is a one-thumb reflex game for iPhone. Shapes appear and grow; pop each one before it finishes growing. The biggest shape on screen is always the oldest and the closest to costing you a life, so take them in the order they arrived.

Questions, bugs, or anything that looks wrong: sven@balnojan.com. I read every mail and answer within a few days.

@sbalnojan
sbalnojan / gist:7089f51d2a1b1d3dc5026702e96c9c63
Last active September 1, 2026 07:35
Privacy Policy version 1.0 for the Roost Run iOS app

The Roost Run iOS app does not collect any user data of any kind. The app does not access the Internet at all.

The only thing the app stores is your best score, which is kept on your device and is deleted when you delete the app.

Support: sven@balnojan.com

@sbalnojan
sbalnojan / gist:28e01f02bd0b9999235c9cc9091fd90c
Last active February 10, 2025 10:42
Privacy Policy version 1.0 for the Death Day Countdown/ Fuzzy Time Clock iOS app

Privacy Policy version 1.0 for the Death Day Countdown/ Fuzzy Time Clock iOS app

The Death Day Countdown/ Fuzzy Time Clock iOS app does not collect any user data of any kind. The app does not access the Internet at all.

import os
from sqlalchemy import create_engine, func
from sqlalchemy.orm.session import sessionmaker
import psycopg2
import logging
def get_db_connection():
PGHOST = os.getenv("DB_HOST","localhost")
PGDATABASE = "postgres"
containers:
build-env:
image: python:3.7
volumes:
- local: .
container: /src
options: cached
- local: .pip-cache
container: /src/.pip-cache
options: cached
containers:
build-env:
image: python:3.7
volumes:
- local: .
container: /src
options: cached
- local: .pip-cache
container: /src/.pip-cache
options: cached
containers:
build-env:
image: python:3.7
working_directory: /src
environment:
PYTHONPATH: "/src"
run_as_current_user:
enabled: true
home_directory: /home/container-user
print("finally, let's do some ranking...")
entity_count = 8
scores, _, _ = comparator(
comparator.prepare(torch.tensor(src_embedding.reshape([1,1,10]))).expand(1, entity_count, 10),
comparator.prepare(torch.tensor(dest_embeddings.reshape([1,8,10]))),
torch.empty(1, 0, 10), # Left-hand side negatives, not needed
torch.empty(1, 0, 10), # Right-hand side negatives, not needed
)
permutation = scores.flatten().argsort(descending=True)
print("Now let's do some simple things within torch:")
from torchbiggraph.model import DotComparator
src_entity_offset = dictionary["entities"]["user_id"].index("0") # France
dest_1_entity_offset = dictionary["entities"]["user_id"].index("7") # Paris
dest_2_entity_offset = dictionary["entities"]["user_id"].index("1") # Paris
rel_type_index = dictionary["relations"].index("follow") # note we only have one...
with h5py.File("model/example_2/embeddings_user_id_0.v10.h5", "r") as hf:
src_embedding = hf["embeddings"][src_entity_offset, :]