Skip to content

Instantly share code, notes, and snippets.

View flozz's full-sized avatar

Fabien LOISON flozz

View GitHub Profile
@flozz
flozz / greasemonkey_notion_lock_page_fr.js
Last active February 16, 2024 16:50
Lock all visited pages on Notion.io
// ==UserScript==
// @name Notion - Lock pages (FR)
// @include *://www.notion.so/*/*
// @version 2
// @grant none
// ==/UserScript==
// I am bored that nobody lock pages on Notion. Edition mode interferes with my
// VIM plugin and I accidentally modify pages instead of navigating...
//
@flozz
flozz / gtk_themes_helpers.py
Created June 27, 2021 13:21
Helpers to deal with GTK 3 themes in Python / PyGObject
"""
This module contains helpers to deal with GTK 3 themes in Python / PyGObject.
Dependencies
------------
* Python 3
* PyGObject
* GLib, Gio and GTK with introspection files
@flozz
flozz / arctis7.py
Last active August 3, 2023 13:40
Displays the battery level of a SteelSeries Acrtis 7 headset.
#!/usr/bin/env python3
"""
This script displays the battery level of a SteelSeries Acrtis 7 headset.
USING
-----
To use this script you must install hidapi (https://github.com/trezor/cython-hidapi):
#!/usr/bin/env python
## DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
## Version 2, December 2004
##
## Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
##
## Everyone is permitted to copy and distribute verbatim or modified
## copies of this license document, and changing it is allowed as long
## as the name is changed.
@flozz
flozz / bgb_debug.h
Last active November 18, 2020 01:09
GameBoy BGB Debug Macros (SDCC)
// BGB Debug -- Help debugging GameBoy programs in BGB
// Copyright (c) 2019 Fabien LOISON <https://flozz.fr/>
// ==== LICENSE ==============================================================
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
// Version 2, December 2004
//
// Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
//
@flozz
flozz / Makefile
Last active January 8, 2022 17:26
Builds a frozen version of WeasyPrint that includes all required dependencies and libraries.
# Builds a frozen version of WeasyPrint (https://github.com/kozea/weasyprint)
# that includes all required dependencies and libraries.
#
# Dependencies:
#
# * GNU make (build-essential package on Debian)
# * Python headers (python3-dev package on Dabian)
# * virtualenv
#
# Usage:
@flozz
flozz / gnome_shell_wayland_meta_window_hack.py
Created May 14, 2018 18:06
A small hack that allows to manipulate windows on GNOME Shell / Wayland
#!/usr/bin/env python
import json
import pydbus
GNOME_SHELL = "org.gnome.Shell"
META_WINDOW_JS = """
(function(params) {
@flozz
flozz / foobar.js
Created April 5, 2018 08:47
JSDoc examples for shpinx-js
/**
*/
class Foobar {
/**
* If we let jsdoc extracting the default values (es6 syntax), the
* result is ok for simple types (number, string, boolean and null)
*
* @param {*} a
* @param {number} [b]
@flozz
flozz / gitea_macaron_log.txt
Created December 6, 2017 09:52
Gitea Macaron log
[Macaron] 2017-12-06 10:41:22: Started GET /test/test-lfs.git/info/refs?service=git-receive-pack for 127.0.0.1
[Macaron] 2017-12-06 10:41:22: Completed GET /test/test-lfs.git/info/refs?service=git-receive-pack 401 Unauthorized in 1.08318ms
[Macaron] 2017-12-06 10:41:26: Started GET /test/test-lfs.git/info/refs?service=git-receive-pack for 127.0.0.1
[Macaron] 2017-12-06 10:41:26: Completed GET /test/test-lfs.git/info/refs?service=git-receive-pack 401 Unauthorized in 2.185333ms
[Macaron] 2017-12-06 10:41:26: Started GET /test/test-lfs.git/info/refs?service=git-receive-pack for 127.0.0.1
[Macaron] 2017-12-06 10:41:26: Completed GET /test/test-lfs.git/info/refs?service=git-receive-pack 200 OK in 56.129674ms
[Macaron] 2017-12-06 10:41:30: Started POST /test/test-lfs.git/info/lfs/locks/verify for 127.0.0.1
[Macaron] 2017-12-06 10:41:30: Completed POST /test/test-lfs.git/info/lfs/locks/verify 200 OK in 35.306103ms
[Macaron] 2017-12-06 10:41:30: Started GET /test/test-lfs.git/info/refs?service=git-upload-pack for 127
@flozz
flozz / desable_touchpad.py
Last active August 24, 2017 12:18
Disables the touchpad of the Thinkpad X1 Carbon under X11. It probably wroks with other PC too.
#!/usr/bin/env python
## DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
## Version 2, December 2004
##
## Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
##
## Everyone is permitted to copy and distribute verbatim or modified
## copies of this license document, and changing it is allowed as long
## as the name is changed.