Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
excuse me, is this facebook

Piotr Dobrowolski Informatic

🤔
excuse me, is this facebook
View GitHub Profile
View gist:8aeed7abf3107c4e64fd07d45e82d084
// TEMP: but must be %APPDATA% for Win, home for Linux, Application Support for OS X
var appPath = process.env.APP_PATH
if (!appPath) {
var appPath = path.join(os.tmpdir(), pkg.name);
if (process.platform === "linux")
appPath = path.join(process.env.HOME, "."+pkg.name);
else if (process.platform === "darwin")
appPath = path.join(process.env.HOME, "Library", "Application Support", pkg.name);
else if (process.platform === "win32")
appPath = path.join(process.env.APPDATA, "stremio", pkg.name);
View AutoMatchExternals.py
# Looks for matching libraries in current project and automatically assigns to current program.
# "Link existing project libraries" doesn't seem to fully work when using bulk import, and this
# pretty much reimplements this.
#
# After running this script you will probably want to use FixupELFExternalSymbolsScript.java too.
#
#@author infowski
#@category Symbol
#@keybinding F11
#@menupath
View gist:7e025c496e66771436fc32acbbd61e1b
networking.networkmanager = {
enable = true;
# Let's just use networkmanager for modem support for now
unmanaged = [ "wlan0" ];
};
systemd.services.NetworkManager.requires = [ "ModemManager.service" ];
systemd.services.ModemManager.requires = [ "rmtfs.service" ];
View gist:b3ed309a8a5a00e584dfb8e5cfa22277
for (fpath, view_function) in app.view_functions.items():
blueprint_name = fpath.split(".")[0] if "." in fpath else None
# only bound methods have a __self__ attribute, so we can check whether
# a view_function is a defined route or something included from a package
# or from Flask by using hasattr.
if not hasattr(view_function, "__self__") and hasattr(
view_function, "__apispec__"
):
docs.register(view_function, blueprint=blueprint_name)
if hasattr(view_function, "view_class"):
View README.md

Advanced Recursive Diffing™

Ever needed to diff two trees of files, while doing some preprocessing on modified files? Well - we've got a solution for you. Or rather... our long friend git has.

Turns out it's perfectly legal to just use git diff --no-index on directories outside of (any) git repository. With that, we can (ab-)use built in git diff per-path/extension preprocessing feature.

@Informatic
Informatic / 50-customca
Last active November 6, 2022 17:32
Let's Encrypt fix for webOS. Tested on 3.8 only, put this into /var/lib/webosbrew/init.d and you should be probably done.
View 50-customca
#!/bin/sh
# Directory to store overlays in (one directory structure is created per overlay configured down below)
OVERLAY_BASE=/var/lib/webosbrew/customca
overlay() {
set -e
overlay_id="$(echo $1 | sed 's;/;__;g')"
unset TARGET SOURCE FSTYPE OPTIONS
eval $(findmnt -P $1)
View gist:c269da5dc2454415cc96f0b0c9ae8bc9
_ca_config = {
"signing": {
"default": {
"expiry": "87600h"
},
"profiles": {
"server": {
"expiry": "87600h",
"usages": [
"signing",
View gist:a3f2dbaca2e91c98e9585ed759221570
{% for serviceName, service in data.services.items() %}
<div class="service">
<code>{{ serviceName }}</code> → <code>{{ service.executable }}</code>
{{ service.categories.items() }}
</div>
{% endfor %}
@Informatic
Informatic / cursors.sh
Created April 16, 2021 18:05
simple tool to apply overlayfs over specific directories
View cursors.sh
#!/bin/sh
# Directory to store overlays in (one directory structure is created per overlay configured down below)
OVERLAY_BASE=/home/root/overlays
overlay() {
set -e
overlay_id="$(echo $1 | sed 's;/;__;g')"
unset TARGET SOURCE FSTYPE OPTIONS
eval $(findmnt -P $1)
@Informatic
Informatic / README.md
Last active January 8, 2023 12:16
openlgtv webOS hacking notes
View README.md

This is just a dump of some interesting undocumented features of webOS (3.8 specifically, on early 2018 4k LG TV) and other development-related tips.

Homebrew app ideas