Skip to content

Instantly share code, notes, and snippets.

View jhenstridge's full-sized avatar
🦘

James Henstridge jhenstridge

🦘
View GitHub Profile
@jhenstridge
jhenstridge / hook.sh
Last active July 1, 2022 07:55
Snapcraft ld.so.cache generation example
#!/bin/sh
set -e
mkdir -p $SNAP_DATA/etc
snap_ld_so_conf=$SNAP_DATA/etc/snap-ld.so.conf
snap_ld_so_cache=$SNAP_DATA/etc/snap-ld.so.cache
real_ld_so_cache=$SNAP_DATA/etc/ld.so.cache
@jhenstridge
jhenstridge / house.json
Created April 26, 2022 05:39
2022 Australian Federal Election candidates
{
"lastUpdated": "2022-04-25T00:30:34.4756381+00:00",
"candidates": [
{
"divisionName": "Bean",
"nonAffiliated": false,
"ballotGivenName": "Sean",
"ballotPosition": 1,
"occupation": "Project Manager",
"partyName": "United Australia Party",
@jhenstridge
jhenstridge / signal-test.go
Last active June 21, 2019 09:30
Demonstrate godbus RemoveSignal panic
package main
import (
"fmt"
"log"
"time"
"github.com/godbus/dbus"
)
@jhenstridge
jhenstridge / passthrough-backend.c
Created October 30, 2018 10:43
A passthrough GSettings backend (with broken change signalling)
#define G_SETTINGS_ENABLE_BACKEND
#include <gio/gio.h>
#include <gio/gsettingsbackend.h>
typedef GSettingsBackendClass PassthroughSettingsBackendClass;
typedef struct _PassthroughSettingsBackend PassthroughSettingsBackend;
struct _PassthroughSettingsBackend
{
GSettingsBackend backend;
@jhenstridge
jhenstridge / snapcraft.yaml
Created July 4, 2018 08:27
Using the gtk-common-themes snap
name: gtk3-demo
version: '0.1'
summary: A demonstration application for features of GTK
description: |
This snap contains the gtk3-demo application, using theme data
provided by one or more external snaps.
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: strict
@jhenstridge
jhenstridge / README.md
Last active November 19, 2018 12:20
Snap desktop application theming experiment
  1. Build all snaps

  2. Install all snaps

  3. Connect interfaces:

    snap connect gtk3-demo:gtk3-themes ubuntu-themes:gtk3-themes
    snap connect gtk3-demo:icon-themes ubuntu-themes:icon-themes

snap connect gtk3-demo:gtk3-themes adwaita-theme:gtk3-themes

@jhenstridge
jhenstridge / gvt-preferences.md
Last active February 13, 2017 10:14
Simplified preferences from group voting tickets for 2017 WA State Election

Agricultural

Party Preferences
Liberal Party LIB, ONP, NAT, ALP, GRN
Pauline Hanson's One Nation ONP, LIB, NAT, ALP, GRN
The Greens (WA) GRN, ALP, NAT, LIB, ONP
THE NATIONALS NAT, LIB, GRN, ALP, ONP
WA Labor ALP, GRN, NAT, LIB, ONP

East Metropolitan

@jhenstridge
jhenstridge / unpdf.py
Created February 13, 2017 08:49
Convert the group voting ticket file for the 2017 WA State Election from PDF to CSV
#!/usr/bin/python3
# Convert the group voting ticket file for the 2017 WA State Election
# from PDF to CSV.
#
# https://www.elections.wa.gov.au/elections/state/sgelection#/sg2017
import csv
import re
import subprocess