Skip to content

Instantly share code, notes, and snippets.

@hholst80
hholst80 / README.md
Last active August 14, 2022 10:33
crystal dreams 2 - see inside a cube effect

Crystal Dreams 2 - View the inside of a cube through a magic block

The effect

There is a rotating cube on the screen. There is also a magic block that enables us to view inside the Cube. The block is a plane with a thickness that always cuts through the center of the Cube. The two shapes rotates around a fixed center point during the entire effect (although the view frustum movies up and beyond). There are some of the usual pixel dust on screen as well, that interacts with the alpha channel but besides that nothing special. The focus of my analysis is of course on the magic block itself.

# This is how we usually do things.
FROM alpine:latest AS t1
RUN <<EOF
find /var/cache/apk
apk add --no-cache build-base
find /var/cache/apk
EOF
# This won't actually do anything. Cache needs to be enabled.
@hholst80
hholst80 / README.md
Created January 8, 2022 11:18
why I run my shit in containers
6  ⌘ ✔  sudo dnf upgrade azure-cli                                                                                                                                                                                                 30s  ~ 
Last metadata expiration check: 0:28:42 ago on lör  8 jan 2022 11:47:32.
Dependencies resolved.

 Problem: problem with installed package python3-azure-cli-telemetry-2.30.0-5.fc35.noarch
  - package python3-azure-cli-telemetry-2.30.0-5.fc35.noarch requires azure-cli = 2.30.0-5.fc35, but none of the providers can be installed
  - cannot install both azure-cli-2.32.0-1.el7.x86_64 and azure-cli-2.30.0-5.fc35.noarch
  - cannot install both azure-cli-2.30.0-5.fc35.noarch and azure-cli-2.32.0-1.el7.x86_64
@hholst80
hholst80 / acryonyms.md
Last active June 7, 2021 12:37
Business acronyms

Marketing

CBM - Community-Based Marketing B2B - Business To Business B2C - Business To Consumer ROI - Return On Investment CMS - Content Management System LMS - Learning Management System ILT - Instructor-Led Training LSP - Logistics Service Provider

Disable search from addres bar

Mozilla Firefox

  1. Open about:config
  2. Disable both keyword.enabled and browser.fixup.alternate.enabled by setting them to false
  3. Success!

Google Chrome

@hholst80
hholst80 / app.py
Created January 23, 2021 19:34
SSE events
import sys
import queue
import threading
import time
import datetime
import uuid
from concurrent.futures import ThreadPoolExecutor
import flask
@hholst80
hholst80 / app.py
Created January 23, 2021 18:05
SSE events
import sys
import queue
from concurrent.futures import ThreadPoolExecutor
import flask
app = flask.Flask(__name__)
executor = ThreadPoolExecutor(max_workers=3)
def format_sse(data, event=None):
@hholst80
hholst80 / Dockerfile
Last active December 30, 2020 14:09
Docker signal
FROM python:3 as base
FROM base as target2
COPY main2.py /
CMD python3 -u main2.py
FROM base as target1
COPY main.py /
CMD python3 -u main.py

Largest submatrix problem

A problem found on Linkedin.

Find the submatrix with the largest sum.

Example given:

A =
@hholst80
hholst80 / sumprod.m
Created August 14, 2018 11:44
summa produkt pussel
K = 100;
A = zeros(K);
B = zeros(K);
for x = 2:K
for y = 2:K
A(x,y) = x + y;
B(x,y) = x * y;
end
end