Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / fs_sample.c
Last active May 14, 2019 04:06
GIO file read/write info
/*
* Build:
* gcc $(pkg-config --cflags gtk+-3.0) fs_sample.c -o fs_sample $(pkg-config --libs gtk+-3.0)
*/
#include <gtk/gtk.h>
void check(const char *path)
{
GFile *file = g_file_new_for_path (path);
@andreldm
andreldm / sample.c
Created February 27, 2019 01:54
GTK CSS issue reproducer
/*
* 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;
GtkWidget *box;
@andreldm
andreldm / bucketsort_sample.json
Created September 17, 2018 13:37
WeDeploy BucketSort Sample
[
{
"date": "2018-04-01",
"price": 11.9
},
{
"date": "2018-04-01",
"price": 84.21
},
{
030822cb-da90-41ac-92ae-e08013a6c04c1535074412389
a533b497764368b4b2e47224e70a2281
MD5: 2192
6263b5919b0912b1d46c4185abba5cac4add04f1
SHA-1: 1708
5bf2e980fd1b8968cd5a4319617c9754af7af70d200bbb3b82dd8eaca8977f41
SHA-256: 1776
b56a4a12187814f8429ebe43bc893ddb6ebb23c0687de3c162889fd1c75bd7e35dba3edef72e4de6503bbeb38846d73fdab3e3339f15343fe6fb329adec240b1
SHA-512: 1793
-------
@andreldm
andreldm / PKGBUILD
Created August 16, 2018 13:53
AUR apfs-fuse-git
# Maintainer: Adam Harvey <adam@adamharvey.name>
pkgname=apfs-fuse-git
pkgver=r54.cecf2aa
pkgrel=1
pkgdesc="FUSE driver for APFS (Apple File System)"
arch=('i686' 'x86_64')
url="https://github.com/sgan81/apfs-fuse"
license=('GPL')
groups=()
depends=('fuse2')
@andreldm
andreldm / sscce2.c
Created August 26, 2017 19:59
SSCCE Thunar shortcuts layout issue (FIXED)
/*
* Short, Self Contained, Correct Example to demostrate Thunar GTK3 issue
* related to shortcuts pane layout.
* More details: https://github.com/andreldm/thunar/issues/40
* Build:
* gcc $(pkg-config --cflags gtk+-2.0) sscce2.c -o sscce2 $(pkg-config --libs gtk+-2.0)
* gcc $(pkg-config --cflags gtk+-3.0) sscce2.c -o sscce2 $(pkg-config --libs gtk+-3.0)
*/
#include <gtk/gtk.h>
@andreldm
andreldm / create_folders.sh
Created August 2, 2017 17:24
Script to create random folders
#!/bin/bash
mkdir -p thunar-test
cd thunar-test
for run in {1..10}; do
FOLDER=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w $(shuf -i 5-40 -n 1) | head -n 1)
mkdir -p $FOLDER
cd $FOLDER
done