Skip to content

Instantly share code, notes, and snippets.

View JonasLoos's full-sized avatar
💭
404

Jonas Loos JonasLoos

💭
404
View GitHub Profile
@JonasLoos
JonasLoos / sd3helper.py
Created June 19, 2024 09:59
Module to help with Stable Diffusion 3 representation extraction from the denoising transformer blocks for existing images
""" Module to help with Stable Diffusion 3 representation extraction from the denoising transformer blocks for existing images.
Usage:
```python
from sd3helper import SD3
sd = SD3()
img = sd('A photo of a cat holding a sign that says "Hello World!"')
representation = sd.get_repr(img)
print(representation.shape)
```
@JonasLoos
JonasLoos / valid_python.py
Last active July 17, 2022 19:54
Just some valid python. Easily understandable. Right?
def _(O):
for o in (_,): ...
OoO = "."+"9" "_"*9+"9"; return O and o(O//(1./float(OoO))),
[print(O) for o in range(42)[::-1] if [O := _(o)]]; None
@JonasLoos
JonasLoos / ENS_alternative.sol
Created March 7, 2022 11:59
exemplary implementation of a fully decentralized ENS alternative
// SPDX-License-Identifier: MIT
// exemplary implementation of a fully decentralized ENS alternative
// The ENS was described as partly centralized (root node controlled by ENS founders), while there is no fully decentralized solution yet.
// Couldn't we simply create a smart contract for the registry which has no owners and provides name-register functionality via a public function?
// To avoid spam and cluttering of the namespace, name-registrations have an expiration date and a cost depending on the duration (e.g. fixed 0.01Eth per month or dynamically adjusting with count of exiting registrations).
// If we want to have a separation between "TLD"s and "subdomains", we can just have one of these smart contracts for each TLD and one for the root (which is read only).
pragma solidity ^0.8.10;
@JonasLoos
JonasLoos / gist:0bb78d0c4331b90f127201e3409ade06
Created March 18, 2021 00:01
log of `sudo key-mapper-gtk -d`: call command, press `Apply`, then `1` (mapped to udiaeresis, causes [) and then exit the app (input source = en)
sudo key-mapper-gtk -d
0.00149 INFO: logger.py, line 155, key-mapper 0.7.0 1f8118ae0a214caa6c135a9174fd09a9ad9c136e https://github.com/sezanzeb/key-mapper
0.00170 INFO: logger.py, line 161, python-evdev 1.3.0
0.00172 WARNING: logger.py, line 167, Debug level will log all your keystrokes! Do not post this output in the internet if you typed in sensitive or private information with your device!
0.00175 DEBUG: logger.py, line 173, pid 6853
0.01692 INFO: config.py, line 246, Loaded config from "/home/jonas/.config/key-mapper/config.json"
0.01709 DEBUG: state.py, line 55, Gathering available keycodes
0.02018 DEBUG: state.py, line 92, Writing "/home/jonas/.config/key-mapper/xmodmap.json"
0.06484 WARNING: daemon.py, line 77, The daemon "key-mapper-service" is not running, mapping keys only works as long as the window is open. Try `sudo systemctl start key-mapper`
0.06494 DEBUG: daemon.py, line 214, Creating daemon
@JonasLoos
JonasLoos / gist:6722b39fd9e8f8d58cf886f965b91033
Created March 16, 2021 11:58
log of `sudo key-mapper-gtk -d`: call command, press `Apply`, then `RIGHTALT+[` and after some time `space` to stop the spam
0.00143 INFO: logger.py, line 155, key-mapper 0.7.0 c6c186f8e8f9d7be0c72e9c5475a9ad96d8af793 https://github.com/sezanzeb/key-mapper
0.00162 INFO: logger.py, line 161, python-evdev 1.3.0
0.00165 WARNING: logger.py, line 167, Debug level will log all your keystrokes! Do not post this output in the internet if you typed in sensitive or private information with your device!
0.00167 DEBUG: logger.py, line 173, pid 6309
0.01774 INFO: config.py, line 246, Loaded config from "/home/jonas/.config/key-mapper/config.json"
0.01790 DEBUG: state.py, line 55, Gathering available keycodes
0.02170 DEBUG: state.py, line 92, Writing "/home/jonas/.config/key-mapper/xmodmap.json"
0.06659 WARNING: daemon.py, line 77, The daemon "key-mapper-service" is not running, mapping keys only works as long as the window is open. Try `sudo systemctl start key-mapper`
0.06666 DEBUG: daemon.py, line 214, Creating daemon
0.06764 DEBUG: data.py, line 85, Found data at "/usr/share/key-mapper"
1 * 1 = 1
11 * 11 = 1 21
111 * 111 = 1 2 321
1111 * 1111 = 12 3 4321
11111 * 11111 = 123 4 54321
111111 * 111111 = 1234 5 654321
1111111 * 1111111 = 12345 6 7654321
11111111 * 11111111 = 123456 7 87654321
111111111 * 111111111 = 1234567 8 987654321
1111111111 * 1111111111 = 12345679 0 0987654321