Skip to content

Instantly share code, notes, and snippets.

@loentar
loentar / krita-drawing-time.sh
Created June 12, 2022 10:00
Calculate total drawing time in Krita. run: krita-drawing-time.sh /path/to/your/kra-files
#!/bin/bash
if [ -n "$1" ]
then
cd "$1"
fi
readableTime() {
value=$1
res="$(($value % 60))s"
# Remap express keys of XP-PEN Artist22E Pro_V3
# Input device ID: bus 0x03 vendor 0x28bd product 0x900b version 0x100
#
# place me into /etc/udev/hwdb.d/10-xp-pen-keyboard.hwdb
# and run:
# sudo udevadm hwdb --update; sudo udevadm trigger
#
# print list of key codes:
# sed -n '/KEY_/{s/.*KEY_\([A-Za-z0-9_]\+\).*/\L\1/g;p}' /usr/include/linux/input-event-codes.h | less
#
@loentar
loentar / uclogic_probe_model_huion_ex.c
Created February 11, 2018 14:30
Better probing the newer Huion tablets name
static int append_string (char** str, int* str_size, const char* what, bool separate)
{
int rc = snprintf(*str, *str_size, separate ? "%s " : "%s", what);
if (rc >= *str_size)
return 1;
*str += rc;
*str_size -= rc;
return 0;
}
@loentar
loentar / gist:1e2d1aa0f9155f602db2a07d99e44b00
Created April 14, 2017 08:49
evobject_workaround_swift_crash.patch
diff -u Source-latest/EVObject.swift Source-patched/EVObject.swift
--- Source-latest/EVObject.swift 2017-04-13 17:35:35.000000000 +0300
+++ Source-patched/EVObject.swift 2017-04-14 11:38:41.000000000 +0300
@@ -121,7 +121,7 @@
- returns: Return an array with value pairs of the object property name and json key name.
*/
- open func propertyMapping() -> [(keyInObject: String?, keyInResource: String?)] {
+ open func propertyMapping() -> Any /*[(keyInObject: String?, keyInResource: String?)]*/ {
return []
--- jquery.flot.pie.js.orig 2016-07-24 11:58:39.000000000 +0300
+++ jquery.flot.pie.js 2016-07-24 12:00:15.496113223 +0300
@@ -126,6 +126,7 @@
if (options.grid.clickable) {
eventHolder.unbind("click").click(onClick);
}
+ eventHolder.unbind("mouseout").mouseout(onMouseOut);
}
});
diff --git a/android/contrib/tools/do-compile-ffmpeg.sh b/android/contrib/tools/do-compile-ffmpeg.sh
index 37545b2..0e438bc 100755
--- a/android/contrib/tools/do-compile-ffmpeg.sh
+++ b/android/contrib/tools/do-compile-ffmpeg.sh
@@ -49,11 +49,19 @@ if [ -z "$FF_ARCH" ]; then
fi
# try to detect NDK version
-FF_NDK_REL=$(grep -o '^r[0-9]*.*' $ANDROID_NDK/RELEASE.TXT 2>/dev/null|cut -b2-)
+if [ -f "$ANDROID_NDK/RELEASE.TXT" ]
diff --git a/gui/freehand.py b/gui/freehand.py
index a9b4c64..7a3f81f 100644
--- a/gui/freehand.py
+++ b/gui/freehand.py
@@ -10,6 +10,7 @@
## Imports
import math
+from sys import float_info
from numpy import array
diff --git a/brushlib b/brushlib
index 96af9e5..ada9924 160000
--- a/brushlib
+++ b/brushlib
@@ -1 +1 @@
-Subproject commit 96af9e5aa1938dd72d1d71515b40aebe5b354141
+Subproject commit ada992407c155809d5f8a5294221b27edd1a825d
diff --git a/gui/layerswindow.py b/gui/layerswindow.py
index a8dcc1d..ed0ca65 100644
--- a/gui/layerswindow.py
diff --git a/lib/blending.hpp b/lib/blending.hpp
index d61c741..0c800ff 100644
--- a/lib/blending.hpp
+++ b/lib/blending.hpp
@@ -107,6 +107,32 @@ class BufferCombineFunc <DSTALPHA, BUFSIZE, BlendNormal, CompositeDestinationOut
// Da' = Da × (1 - Sa)
+template <bool DSTALPHA, unsigned int BUFSIZE>
+class BufferCombineFunc <DSTALPHA, BUFSIZE, BlendNormal, CompositeDestinationAtop>
diff --git a/brushlib b/brushlib
index f6af776..0a6ad9d 160000
--- a/brushlib
+++ b/brushlib
@@ -1 +1 @@
-Subproject commit f6af7763a77530e8f50b3b4f9f4019c4f68fb820
+Subproject commit 0a6ad9de9debb9786bcc23cef19446410ac042a5
diff --git a/gui/stategroup.py b/gui/stategroup.py
index 63cfdbd..7cfa292 100644
--- a/gui/stategroup.py