Skip to content

Instantly share code, notes, and snippets.

View murny's full-sized avatar

murny

  • Canada
View GitHub Profile
@lazaronixon
lazaronixon / _form.html.erb
Last active September 22, 2025 15:08
Hotwire Event-Driven Update Pattern
<%= form_with model: citizen, class: "card flex flex-col gap", data: { controller: "form" } do |form| %>
<div class="flex flex-col gap mb-2">
<div class="flex flex-col gap-half">
<% countries = Country.order(:name) %>
<%= label_tag :country_id, "Country", class: "text-sm font-medium leading-none" %>
<%= select_tag :country_id, options_from_collection_for_select(countries, :id, :name, citizen.country_id), include_blank: "Select one", class: "input", data: { action: "form#submit", form_submitter_param: "on_country_change" } %>
</div>
<div class="flex flex-col gap-half">
<% states = State.where(country_id: citizen.country_id).order(:name) %>
@rameerez
rameerez / kamal-production-server-setup.sh
Last active October 9, 2025 05:50
Set up a Ubuntu server to deploy Kamal 2.x Docker containers to, hardened security and production ready
#!/bin/bash
# Production Docker Host Hardening Script v2
# For Ubuntu Server 24.04 LTS (Noble)
# Suitable for both Kamal deployment and builder hosts
set -euo pipefail
IFS=$'\n\t'
# --- Constants ---
@cwant
cwant / dokku-presentation-script.md
Last active June 10, 2023 16:54
Dokku on Compute Canada cloud demo

Dokku on the Compute Canada cloud

First: lets provision a cloud VM

Lets spin up a cloud VM so we can talk about other stuff while we wait.

  • Deploy an Ubuntu 18.04 instance.
  • Make sure the keypair is injected
  • Make sure to associate the static IP to the one used for DNS (see below)
  • Don't forget to set a disk size!!!! (20GB will do)
@sj26
sj26 / README.md
Created January 19, 2012 07:41
Run MailCatcher in the background, always, on OS X

Place me.mailcatcher.plist into ~/Library/LaunchAgents, then run launchctl load ~/Library/LaunchAgents/me.mailcatcher.plist.

If you use pow, echo 1080 > ~/.pow/mailcatcher and go to http://mailcatcher.dev, otherwise use http://localhost:1080.

Currently pow doesn't seem to pass websockets through correctly. Looking into this.