Skip to content

Instantly share code, notes, and snippets.

View GGLinnk's full-sized avatar

Gabriel Grondin GGLinnk

View GitHub Profile
@GGLinnk
GGLinnk / miro.com-dark.css
Last active June 13, 2023 21:58
GGLinnk's W.I.P Dark Theme for miro.com
/* ==UserStyle==
@name GGLinnk's Dark Theme for miro.com
@version 20230614.00.00
@namespace gglinnk.virtualworld.fr
@description This is a W.I.P. dark theme for miro.com that totally IGNORE the css name mangle.
Tested on Firefox with Stylus.
@author GGLinnk
@license CC BY-NC-SA - Creative Commons Attribution-NonCommercial-ShareAlike
==/UserStyle== */
@-moz-document url-prefix("https://miro.com/app/board/") {
@GGLinnk
GGLinnk / co_import.sh
Last active September 4, 2023 18:48
Scripts for migrating CoreProtect database.db data to MySQL server - https://ralph.sh/coreprotect-sqlite-de20a
#!/bin/bash
# co_import.sh -- Import migrated CoreProtect data into a MySQL server.
# Copyright (C) 2019 Ralph Drake
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@GGLinnk
GGLinnk / 1-voice-synthesis.js
Last active December 9, 2022 06:41 — forked from kesor/1-voice-synthesis.js
Making chat OpenAI use TTS with pretty button for 1 and 2 ^^
// paste this into your chrome dev console for Speech Synthesis
// This version use a pretty button ^^
const originalFetch = window.fetch
const patchedFetch = (...args) => {
if (args[1].method == 'POST' && args[1].body.length > 0 && /moderations$/.test(args[0])) {
const aiResponse = JSON.parse(args[1].body)["input"].split("\n\n\n")
if (aiResponse.length > 1) {
const text = aiResponse.slice(1).join(". ").trim()
@GGLinnk
GGLinnk / crate.io-dark.css
Last active March 24, 2024 00:47
GGLinnk's Dark Theme for Crates.io
/* ==UserStyle==
@name GGLinnk's Dark Theme for Crates.io
@version 20240324.00.46
@namespace crates.io.gglinnk.virtualworld.fr
@description This is a almost finished dark theme for crates.io that totally IGNORE the css name mangle.
Tested on Firefox and Chrome with Stylus.
@author GGLinnk
@license CC BY-NC-SA - Creative Commons Attribution-NonCommercial-ShareAlike
==/UserStyle== */
@-moz-document domain("crates.io") {
@GGLinnk
GGLinnk / README.md
Last active May 19, 2022 16:59
A python script that zips files individually and recursively from the location where it is executed or the path given as an argument.

ZIP-ALL

A python script that zips files individually and recursively from the location where it is executed or the path given as an argument.

Warning

  • THIS VERSION IS NOT TESTED! USE AT YOUR OWN RISK
  • All original files will be deleted once compressed!
  • Try to avoid running it multiple times, it does not exclude known compressed formats like other zip or rar.
  • This script uses the highest compression rate available. Note that compression can take a lot of time and power.

Instructions

@GGLinnk
GGLinnk / get_blender_materials.py
Created April 28, 2022 02:03
Blender Python API: Gets materials by creating them or getting them by name.
import bpy
def get_material(material_name: str) -> bpy.types.Material:
return bpy.data.materials.get(material_name) or bpy.data.materials.new(name=material_name)
def get_materials(material_names: list) -> list:
return [get_material(mat_name) for mat_name in material_names]
if __name__ == __main__:
get_material("TEST_MAT")
@GGLinnk
GGLinnk / get_blender_collection.py
Last active April 28, 2022 02:04
Blender Python API: Gets collections by creating them or getting them by name.
import bpy
def get_collection(collection_name: str) -> bpy.types.Collection:
return bpy.data.collections.get(collection_name) or bpy.data.collections.new(collection_name)
def get_collections(collection_names: list) -> list:
return [get_collection(collection_name) for collection_name in collection_names]
if __name__ == __main__:
get_collection("TEST_COLLECTION")
@GGLinnk
GGLinnk / polar.py
Last active April 28, 2022 01:47
Python Maths : Calculate the distance of two points from polar coordinates (angle and distance from point 0).
import math
def polar_distance(self, distance: float, distance_cmp: float, angle: float, angle_cmp: float):
p1 = distance
p2 = distance_cmp
a = math.cos(angle_cmp - angle)
return math.sqrt(p1 ** 2 + p2 ** 2 - 2 * p1 * p2 * a)
@GGLinnk
GGLinnk / autotest.py
Last active November 19, 2021 20:47
PzzTool Autotest. Must be use with pzztool.py from https://github.com/Virtual-World-RE/NeoGF and unpacked pzz file.
from argparse import ArgumentParser;
import pzztool
import hashlib
import json
import os
__author__ = "GGLinnk"
__copyright__ = "Copyright 2021 - Virtual World RE"
@GGLinnk
GGLinnk / group_magic_bytes.py
Last active October 22, 2021 23:13
Group Magic Bytes | Python script that group Magic Bytes of files in folder, show retrived bytes and show associated file. This is not the final version!
#!/bin/env python3
from sys import argv, stderr
from os import listdir, path
import binascii
linkPath = path.normpath(argv[1])
if not path.exists(linkPath):
print(f"Folder doesn't exists: [{linkPath}]", file=stderr)
exit(1)