This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/usr/pwsh | |
# Prefixes for registry key paths. | |
$currentVersion = 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion' | |
$consentStore = "${currentVersion}\CapabilityAccessManager\ConsentStore" | |
$deviceAccess = "${currentVersion}\DeviceAccess" | |
# A list of Objects like. | |
# { Description: String, RegistryKey: String, Value: Int } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define MIN3(a, b, c) ((a) < (b) ? ((a) < (c) ? (a) : (c)) : ((b) < (c) ? (b) : (c))) | |
/* LEVENSHTEIN DISTANCE | |
* | |
* @s1 and @s2 are character arrays of size @n1 and @n2, which represent two | |
* strings. Any null bytes are treated like a normal character, so strings | |
* without a terminating null byte are valid input. | |
* | |
* The LEVENSHTEIN DISTANCE between @s1 and @s2 is the smallest number of | |
* insertions, deletions, or substitutions needed to transform @s1 into @s2. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Disable scroll on a widget by adding a capture phase event handler and | |
* connecting a no-op callback to the "scroll" event. | |
*/ | |
static GtkWidget * | |
disable_scroll( GtkWidget *w ) | |
{ | |
GtkEventController *ec; | |
ec = gtk_event_controller_scroll_new( | |
GTK_EVENT_CONTROLLER_SCROLL_VERTICAL ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* No-op to prevent @w from propagating "scroll" events it receives. | |
*/ | |
void disable_scroll_cb( GtkWidget *w ) {} | |
/* Disable scroll on a widget by adding a capture phase event handler and | |
* connecting a no-op callback to the "scroll" event. | |
*/ | |
static GtkWidget * | |
disable_scroll( GtkWidget *w ) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* No-op to prevent @w from propagating "scroll" events it receives. | |
*/ | |
void disable_scroll_cb( GtkWidget *w ) {} | |
/* Disable scroll on a widget by adding a capture phase event handler and | |
* connecting a no-op callback to the "scroll" event. | |
*/ | |
static GtkWidget * | |
disable_scroll( GtkWidget *w ) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* g_match_with_mismatches_v3.c | |
* | |
* Search for fuzzy matches of a pattern in text with @k or fewer mismatches | |
* (substitutions). Uses doubly-linked list GList from GLib. | |
* | |
* COMPILE | |
* | |
* gcc `pkg-config --cflags glib-2.0` -o g_match_with_mismatches_v3 g_match_with_mismatches_v3.c `pkg-config --libs glib-2.0` | |
* | |
* RUN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* g_match_with_mismatches_v2.c | |
* | |
* Search for fuzzy matches of a pattern in text with @k or fewer mismatches | |
* (substitutions). Uses doubly-linked list GList from GLib. | |
* | |
* COMPILE | |
* | |
* gcc `pkg-config --cflags glib-2.0` -o g_match_with_mismatches_v2 g_match_with_mismatches_v2.c `pkg-config --libs glib-2.0` | |
* | |
* RUN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* search_with_mismatches.c | |
* | |
* COMPILE | |
* | |
* gcc `pkg-config --cflags gtk4` -o search_with_mismatches search_with_mismatches.c `pkg-config --libs gtk4` | |
* | |
* RUN | |
* | |
* search_with_mismatches | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* g_match_with_mismatches.c | |
* | |
* Search for fuzzy matches of a pattern in text with @k or fewer mismatches | |
* (substitutions). Uses doubly-linked list GList from GLib. | |
* | |
* COMPILE | |
* | |
* gcc `pkg-config --cflags glib-2.0` -o g_match_with_mismatches g_match_with_mismatches.c `pkg-config --libs glib-2.0` | |
* | |
* RUN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* match_with_mismatches.c | |
* | |
* Search for fuzzy matches of a pattern in text with @k or fewer mismatches | |
* (substitutions). | |
* | |
* COMPILE | |
* | |
* gcc -o match_with_mismatches match_with_mismatches.c | |
* | |
* RUN |
NewerOlder