Skip to content

Instantly share code, notes, and snippets.

View thejhh's full-sized avatar
💭
Excellence isn't believing you're best; It's about always striving to get better

Jaakko Heusala thejhh

💭
Excellence isn't believing you're best; It's about always striving to get better
View GitHub Profile
@thejhh
thejhh / analyze_fields.py
Created April 15, 2025 21:31
Code to detect where sky meets land
import cv2
import numpy as np
import matplotlib.pyplot as plt
from pathlib import Path
import json
from scipy.ndimage import gaussian_filter1d
import logging
import sys
import traceback

"Vibe a Flower" -ominaisuus VibeFlowersissa kutsuu pelaajat lempeään, tunteita ilmentävään rituaaliin – hetkeen, jossa sisäiset tunteet muuttuvat ainutlaatuisiksi digitaalisiksi kukinnoiksi. Sen sijaan, että pelaaja vain valitsisi kukan, hän osallistuu hitaaseen, tietoiseen luomisprosessiin, joka alkaa aikomuksesta ja päättyy runolliseen palkintoon.

Kun pelaaja päättää "vibettää" uuden kukan, hän aloittaa ilmaisemalla, miltä hänestä tuntuu. Hän voi valita valmiista tunnetiloista – kuten toiveikas, kiitollinen tai rauhallinen – tai kirjoittaa itse lyhyen tunteensa, kuten lämmin suru, irti päästäminen tai uusi alku. Tämä emotionaalinen syöte muodostaa kokemuksen ytimen.

Tämän jälkeen pelaaja voi halutessaan ohjata luomista tarkemmin. Valinnaisissa asetuksissa voi valita mieluisan väripaletin, säätää tunnetilan voimakkuutta (lempeästä rohkeaan) ja lisätä symboleja tai ideoita, jotka liittyvät kyseiseen tunteeseen – kuten auringonnousu, ystävyys tai uudet alut. Pelaaja voi myös valita yleisen kukkatyypin tai ki

import asyncio
import logging
from zigpy_znp.zigbee.application import ControllerApplication
import zigpy_znp.config as znp_config
async def connect_zigbee():
# Set up logging to see detailed output (optional)
logging.basicConfig(level=logging.DEBUG)
# Create the configuration dictionary
@thejhh
thejhh / go-binary-operations.md
Last active October 29, 2024 08:09
GoLang binary operations

GoLang binary operators

Binary operators

Operation Symbol Example Result Description
AND & 10101010 & 11001100 10001000 1 if both bits are 1
OR | 10101010 | 11001100 11101110 1 if at least one bit is 1
XOR ^ 10101010 ^ 11001100 01100110 1 if bits are different
NOT ^ ^10101010 01010101 Flips each bit
@thejhh
thejhh / computer.go
Created September 28, 2024 19:38
Simple Chess Computer Player
// Copyright (c) 2024. Hangover Games <[email protected]>. All rights reserved.
package basicchesscomputer
import (
"chess/internal/chess"
"math/rand"
"time"
"chess/internal/chesserrors"
// Copyright (c) 2024. Hangover Games <[email protected]>. All rights reserved.
// Licence FSL-1.1-MIT
package bishop
import (
"log"
"chess/internal/chesstypes"
)
@thejhh
thejhh / quest-scrcpy.sh
Last active July 16, 2024 14:23
Screen copy command for Quest 2 and Quest 3 headsets
#!/bin/bash
# scrcpy for quest 2 and quest 3
# Copyright 2020-2024 Jaakko Heusala <[email protected]>
# Version 1
set -e
set -x
VIDEO_BITRATE=25M
PORT=5555
@thejhh
thejhh / gist:057be2d186a46b151868ecf24c2bd18f
Created November 14, 2021 20:22
bin/fix-log-timestamp.sh
#!/bin/bash
while read LINE; do
TIME="$(echo "$LINE"|awk '{print $1}')"
FIXED_TIME="$(date -d "$TIME" '+[%d/%b/%Y:%H:%M:%S %z]')"
echo -n "$FIXED_TIME "
echo "$LINE"|sed -re 's/^[^ ]+ //'
done
@thejhh
thejhh / list-rooms-by-state.ts
Created August 25, 2021 15:26
List Matrix rooms by latest room state
const response : MatrixSyncResponseDTO = await this._client.sync({
filter: {
presence: {
limit: 0
},
account_data: {
limit: 0
},
room: {
account_data: {
@thejhh
thejhh / git-archive.ps1
Last active February 3, 2025 08:50
Simple script to archive branches as a git tag
# Origin: https://gist.github.com/thejhh/7e505fdc56d08253cdaf7de5f25838db
# USAGE: .\git-archive.ps1 BRANCH [...BRANCH_N]
$ErrorActionPreference = "Stop"
#$VerbosePreference = "Continue"
$DATE = Get-Date -Format "yyyyMMdd-HHmmss"
foreach ($BRANCH_NAME in $args) {
$ARCHIVE_TAG_NAME = "archive/$DATE-$BRANCH_NAME"