Skip to content

Instantly share code, notes, and snippets.

View lukasgabriel's full-sized avatar
🗿

Lukas Gabriel lukasgabriel

🗿
View GitHub Profile
@lukasgabriel
lukasgabriel / README.md
Last active May 22, 2024 09:41
ChatGPT Raindrop.io Plugin/GPT

README

This is the metadata and OpenAPI spec I created for a custom ChatGPT plugin (or GPT, as OpenAI calls them) that can search your Raindrop.io bookmark library for you. It is tested and working, albeit with mixed results when dealing with large amounts of tags and collections. With further tuning of the system prompt and OpenAPI spec, it could be vastly improved.

Here is the unpublished plugin: https://chat.openai.com/g/g-uNdVJh9vu-raindrop-io-search-assistant
I will update it if I ever get the OAuth to work, until then, it won't work unfortunately.

I decided against publishing on the 'GPT Store' because I could not get the OAuth login to work despite following Raindrop.io and OpenAI documentation closely. Also, such an integration should probably be provided by the Raindrop.io devs anyways.

Keybase proof

I hereby claim:

  • I am lukasgabriel on github.
  • I am lukasgab (https://keybase.io/lukasgab) on keybase.
  • I have a public key ASDbOuU6jaflVrWJ2COevQsfxkkCSMqDDpxSOa6HVig5-Qo

To claim this, I am signing this object:

def correlation_coefficient(y_true, y_pred):
'''
This function is for singleduration model.
'''
max_y_pred = K.repeat_elements(K.expand_dims(K.repeat_elements(K.expand_dims(K.max(K.max(y_pred, axis=1), axis=1), axis=1),
shape_r_out, axis=1), axis=2), shape_c_out, axis=2)
y_pred /= max_y_pred
sum_y_true = K.repeat_elements(K.expand_dims(K.repeat_elements(K.expand_dims(K.sum(K.sum(y_true, axis=1), axis=1), axis=1),
shape_r_out, axis=1), axis=2), shape_c_out, axis=2)
@lukasgabriel
lukasgabriel / manyimg2pdf.py
Created October 12, 2022 06:32
Convert nested images to PDF
import img2pdf
import pathlib
import os
ROOT_FOLDER = pathlib.WindowsPath("C:/Users/lukas/Desktop/sample/")
DEST_FOLDER = "C:/Users/lukas/Desktop/artbooks/"
FORMATS = [".jpg", ".jpeg", ".png", ".tif", ".tiff"]
@lukasgabriel
lukasgabriel / group_files.py
Created March 3, 2022 17:13
Groups files into folders by the first letter of the filename. If a threshold is set, the script makes sure that the number of items in a directory doesn't exceed the threshold, creating a new "sub-layer" by second letter (and third, fourth, ...) instead, until MAX_DEPTH is reached.
# group_files.py
from pathlib import WindowsPath
import os
THRESHOLD_MODE = True
THRESHOLD = 32
MAX_LEVELS = 4
# sortfilenames.py
# Run this command first to get the LongName.txt: dir Y:\ /s /b | sort /+143 /r > LongName.txt
from pathlib import WindowsPath
paths = []
# Make sure to (re-)save the text file as UTF-8 !
with open("LongName.txt", "r", encoding="utf-8") as infile:
# community
# by https://github.com/lukasgabriel
from distutils import util
from typing import Optional, Dict, Union, Set, List
from ciphey.iface import ParamSpec, Cracker, CrackResult, CrackInfo, T, registry, Config
@registry.register
# atbash.py
from typing import Optional, Dict, List
from ciphey.iface import Config, T, U, Decoder, registry
@registry.register
class Atbash(Decoder[T, U]):
def decode(self, ctext: T) -> Optional[U]: