Skip to content

Instantly share code, notes, and snippets.

Andre Miranda andreldm

View GitHub Profile
@andreldm
andreldm / test.py
Last active Aug 3, 2020
Corsair Harpoon RGB Wireless basic protocol debugging, see https://github.com/andreldm/harpoond
View test.py
# Setup:
# python -m venv env
# source env/bin/activate
# pip install pyusb
#
# Execute with: sudo python test.py
# See udev rule present in (2) if you want to avoid running as root.
#
# References:
# 1. https://wiki.wireshark.org/CaptureSetup/USB
@andreldm
andreldm / Main.java
Last active Jul 7, 2020
Java time zones
View Main.java
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;
import java.util.stream.Collectors;
@andreldm
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
andreldm / README.md
Last active Mar 25, 2020
A simple daemon implementing freedesktop.org's file manager interface.
View README.md

Forked from: https://gist.github.com/PotatoesMaster/8038613

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
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
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(express.static('static'));
app.use('/proxy', proxy((req) => req.header('X-Proxy-Target')));
app.listen(3000, () => console.log("App running at port 3000"));
@andreldm
andreldm / sample.glade
Created Oct 19, 2019
Headerbar linked buttons
View sample.glade
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<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
andreldm / sample.html
Created Oct 8, 2019
Firefox Cantarell Issue
View sample.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
body {
font-family: system-ui, 'Open Sans', Roboto, 'Helvetica Neue', sans-serif
}
</style>
</head>
@andreldm
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
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)
{
You can’t perform that action at this time.