Skip to content

Instantly share code, notes, and snippets.

View digitalWestie's full-sized avatar

Rory digitalWestie

View GitHub Profile
@digitalWestie
digitalWestie / sensemaking-guide.md
Last active December 4, 2025 17:06
Analysing Civic Conversations with Sensemaking Tools (WIP)

Analysing Civic Conversations with Sensemaking Tools

1. Introduction

This guide provides practical, step-by-step guidance for conducting sensemaking analyses of civic conversations. It covers the analytical workflow from problem framing through to creating trustworthy outputs for decision-makers.

This guide focuses on the analytical process. For guidance on organising deliberations, recruitment, and community engagement, see Jigsaw's "How to run a civic conversation" guide.

Note: The workflow described here is iterative rather than strictly linear. You will move back and forth between activities depending on what you discover and the questions you're trying to answer.

@digitalWestie
digitalWestie / _README.md
Last active December 2, 2025 17:30
RRule strategy for Stimulus.js

RRule Builder for Rails

A Stimulus-based RRULE (iCalendar recurrence rule) builder component for Rails applications. This provides a user-friendly interface for creating recurring event schedules without requiring external dependencies like jQuery UI or React.

Overview

This RRule builder generates iCalendar-compliant RRULE strings that can be used with libraries like rrule (Ruby gem) or rrule.js (JavaScript) to calculate recurring event occurrences.

Features:

  • ✅ Pure Stimulus controller (no jQuery UI or React dependencies)
@digitalWestie
digitalWestie / turbo_association.md
Last active September 16, 2025 14:22
Turbo frame association pattern

Rails Turbo Frame Association Pattern (Updated)

A clean approach for managing many-to-many associations with search, add, and remove functionality using Turbo Frames in Rails. This updated version includes partial-based search results and bidirectional associations.

Overview

This pattern allows users to:

  • Search for items to associate
  • Add items to an association
  • Remove items from an association
@digitalWestie
digitalWestie / hamburger.html.erb
Created August 5, 2025 14:54
hamburger menu strategy for erb
<details class="relative [&>summary::-webkit-details-marker]:hidden [&>summary::marker]:hidden [&>summary]:list-none user-menu [&[open]>summary]:text-gray-600">
<summary class="cursor-pointer text-gray-400 border border-gray-400 rounded-full p-2" data-action="mouseenter->utility#openSummary toggle->utility#toggleSummaryStyle">
<%= user_icon("w-6 h-6 text-inherit") %>
</summary>
<div class="absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 z-50 border border-gray-200">
<%= link_to "View Profile", profile_path, class: "block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" %>
<%= link_to "Edit Profile", edit_profile_path, class: "block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" %>
<%= link_to "Settings", edit_user_registration_path, class: "block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" %>
<%= link_to "Sign out", destroy_user_session_path, data: { turbo_method: :delete }, class: "block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" %>
</div>
@digitalWestie
digitalWestie / AREADME.md
Last active December 20, 2024 18:05
Visualise your commits

gitvis - A git log visualiser in your terminal

image

@digitalWestie
digitalWestie / metadata.md
Created December 18, 2024 13:09
metadata options

In website headers you can link to your chosen licence, e.g. in the case of creative commons:

<link rel="license" href="http://creativecommons.org/licenses/by/4.0/" />

Likewise there's the Dublin core standard version:

@digitalWestie
digitalWestie / text-extract.md
Last active November 19, 2024 12:42
A strategy for recurisvely downloading a site and extracting the text to markdown.

Extracting text

Download site recursively

wget --mirror --convert-links --page-requisites --no-parent -P output_directory https://example.com

Options:

@digitalWestie
digitalWestie / _explainer.md
Last active January 19, 2024 13:05
Rails nested attributes view strategy

Putting related 0 to many resources within a form

For example, we have Paper and EvidenceItem models. We want to let the user add/remove/edit EvidenceItems while they are adding or editing Paper records.

The Paper model looks like this:

class Paper < ApplicationRecord

 has_many :evidence_items, dependent: :destroy
@digitalWestie
digitalWestie / cool_icons_bro.md
Last active April 29, 2025 19:13
Unicode Icon Cheatsheet
@digitalWestie
digitalWestie / titanic.csv
Created September 18, 2023 20:11
Stanford cleaned Titanic passengers dataset
Survived Pclass Name Sex Age Siblings/Spouses Aboard Parents/Children Aboard Fare
0 3 Mr. Owen Harris Braund male 22 1 0 7.25
1 1 Mrs. John Bradley (Florence Briggs Thayer) Cumings female 38 1 0 71.2833
1 3 Miss. Laina Heikkinen female 26 0 0 7.925
1 1 Mrs. Jacques Heath (Lily May Peel) Futrelle female 35 1 0 53.1
0 3 Mr. William Henry Allen male 35 0 0 8.05
0 3 Mr. James Moran male 27 0 0 8.4583
0 1 Mr. Timothy J McCarthy male 54 0 0 51.8625
0 3 Master. Gosta Leonard Palsson male 2 3 1 21.075
1 3 Mrs. Oscar W (Elisabeth Vilhelmina Berg) Johnson female 27 0 2 11.1333