Skip to content

Instantly share code, notes, and snippets.

@andreldm
andreldm / xfce412vs413.md
Created May 15, 2019 02:41
Xfce 4.12 vs 4.13 Memory Comparison

Xfce 4.12 vs 4.13 Memory Comparison

Setup

  • Raspberry Pi 2 (quad-code ARMv7 @900Mhz, 1GB Ram)
  • 16GB class 10 SD Card
  • 1920x1080 display
  • Arch Linux ARM updated @ 2019-05-01
  • Kernel 4.19.37
  • Theme/Icons: Adwaita
@andreldm
andreldm / icon_tester.c
Last active June 29, 2020 22:32
Icon lookup tester
/*
* Build:
* gcc $(pkg-config --cflags gtk+-3.0) icon_tester.c -o icon_tester $(pkg-config --libs gtk+-3.0)
*/
#include <gtk/gtk.h>
int main (int argc, char *argv[])
{
gtk_init (&argc, &argv);
@andreldm
andreldm / menu-items-icons-sample.c
Last active April 27, 2022 13:47
How to avoid GtkImageMenuItem and keep icons on menu items
/*
* 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)
{
@andreldm
andreldm / sample.c
Created September 7, 2019 02:04
Non-transient dialog with minimize button (which doesn't work)
/*
* 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 / sample.html
Created October 8, 2019 23:54
Firefox Cantarell Issue
<!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.glade
Created October 19, 2019 20:59
Headerbar linked buttons
<?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 / app.js
Created March 19, 2020 17:55
Express Proxy POC
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 / popover_sample.c
Last active June 30, 2020 00:09
GTK Popover sample
/*
* 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 / README.md
Last active March 25, 2020 23:48
A simple daemon implementing freedesktop.org's file manager interface.

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 / Main.java
Last active May 18, 2023 11:15
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;
import java.util.stream.Collectors;