Skip to content

Instantly share code, notes, and snippets.

View hoverlover's full-sized avatar

Chad Boyd hoverlover

View GitHub Profile
@hoverlover
hoverlover / faking_it_with_savon.rb
Created April 20, 2012 20:09
Faking it with Savon. Returns a fake response instead of hitting the soap service.
require 'spec_helper'
describe "Faking it with Savon" do
before do
Savon.hooks.define "Fake Response", :soap_request do
HTTPI::Response.new(200, {}, "<Envelope><Body><response>Success!</response></Body></Envelope>")
end
after do
Savon.hooks.reject! "Fake Response"
@hoverlover
hoverlover / add_fieldset.js
Created August 31, 2012 14:00
Dynamically add fieldset to sencha FormPanel
App.views.creditCardForm.items.items[0].up('form').insert(1, {
xtype: 'fieldset',
id: 'customerInfoFormFieldset',
title: 'Name and Address Details',
instructions: 'Please enter your name and address.',
defaults: {
xtype: 'textfield',
labelAlign: 'left',
labelWidth: '40%',
required: false,
@hoverlover
hoverlover / pg_locking.rb
Last active July 27, 2024 16:51
PG::LockNotAvailable rescue woes
def save_with_lock
r = Record.first
# This will raise PG::LockNotAvailable if already locked
#
r.with_lock("FOR UPDATE NOWAIT") do
# do stuff
end
# This rescue block isn't executed for some reason??
@hoverlover
hoverlover / smart-commit.md
Created January 13, 2026 19:52
A Claude Code slash command that analyzes your uncommitted changes and creates logical, atomic commits automatically. It understands your code changes at a semantic level and groups them by feature, not just by file.

Smart Commit

Analyze all uncommitted changes in the project and create logical, atomic commits that group related changes together. Each commit must be self-contained and leave the codebase in a compilable, working state.

This command supports partial file commits — when a single file contains changes for multiple features, it will split them into separate commits automatically.

Instructions

Step 1: Gather Information