Skip to content

Instantly share code, notes, and snippets.

andreldm /
Last active Aug 3, 2020
Corsair Harpoon RGB Wireless basic protocol debugging, see
# Setup:
# python -m venv env
# source env/bin/activate
# pip install pyusb
# Execute with: sudo python
# See udev rule present in (2) if you want to avoid running as root.
# References:
# 1.
andreldm /
Last active Jul 7, 2020
Java time zones
import java.time.Instant;
import java.time.ZoneId;
import java.time.format.TextStyle;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Set;
andreldm / 1.diff
Last active Apr 11, 2020
appfinder diffs
View 1.diff
diff --git a/src/appfinder-window.c b/src/appfinder-window.c
index 777634a..6096c52 100644
--- a/src/appfinder-window.c
+++ b/src/appfinder-window.c
@@ -688,6 +688,16 @@ xfce_appfinder_window_view_button_press_event (GtkWidget *widget,
+static gboolean
+xfce_appfinder_window_refilter (gpointer data)
andreldm /
Last active Mar 25, 2020
A simple daemon implementing's file manager interface.

Forked from:

Use D-Feet to test or commands such as:

dbus-send --print-reply=literal --dest=org.freedesktop.FileManager1 /org/freedesktop/FileManager1 org.freedesktop.FileManager1.ShowItems array:string:'/path/to/some/file.txt' string:''
andreldm / popover_sample.c
Last active Jun 30, 2020
GTK Popover sample
View popover_sample.c
* Build:
* gcc $(pkg-config --cflags gtk+-3.0) popover_sample.c -o popover_sample $(pkg-config --libs gtk+-3.0)
#include <gtk/gtk.h>
int main (int argc, char *argv[])
GtkWidget *window;
andreldm / app.js
Created Mar 19, 2020
Express Proxy POC
View app.js
const express = require('express');
const proxy = require('express-http-proxy');
const app = express();
app.use('/proxy', proxy((req) => req.header('X-Proxy-Target')));
app.listen(3000, () => console.log("App running at port 3000"));
andreldm /
Created Oct 19, 2019
Headerbar linked buttons
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<requires lib="gtk+" version="3.20"/>
<object class="GtkWindow" id="window">
<property name="can_focus">False</property>
<property name="default_width">250</property>
<property name="default_height">150</property>
<child type="titlebar">
<object class="GtkHeaderBar">
andreldm / sample.html
Created Oct 8, 2019
Firefox Cantarell Issue
View sample.html
<!DOCTYPE html>
<meta charset="UTF-8">
body {
font-family: system-ui, 'Open Sans', Roboto, 'Helvetica Neue', sans-serif
andreldm / sample.c
Created Sep 7, 2019
Non-transient dialog with minimize button (which doesn't work)
View sample.c
* Build:
* gcc $(pkg-config --cflags gtk+-3.0) sample.c -o sample $(pkg-config --libs gtk+-3.0)
#include <gtk/gtk.h>
int main (int argc, char *argv[])
GtkWidget *window, *dialog;
andreldm / menu-items-icons-sample.c
Last active Aug 14, 2019
How to avoid GtkImageMenuItem and keep icons on menu items
View menu-items-icons-sample.c
* Build:
* gcc $(pkg-config --cflags gtk+-3.0) sample.c -o sample $(pkg-config --libs gtk+-3.0)
#include <gtk/gtk.h>
static GtkWidget*
create_menu_item (const gchar *str, const char *icon_name)