Skip to content

Instantly share code, notes, and snippets.

View awilkening's full-sized avatar

Avery Wilkening awilkening

View GitHub Profile
@awilkening
awilkening / cleanup_branches.sh
Created January 23, 2026 19:22
Script to clean up git branches by checking merge status and attempting rebase
#!/bin/bash
# Script to clean up git branches
# 1. First checks if branch is already merged into master (safe to delete)
# 2. Then checks if branch has any unique commits not in master
# 3. If rebase succeeds, attempts soft delete
# 4. If rebase fails, leaves branch for manual review
cd /Users/awilkening/Workspace/ucweb
def smush(array, container = [])
array.each do |element|
if element.is_a? Array
smush element, container
else
container << element
end
end
container
I would like to locate a partial in the app/views dir to be shared by two name spaces. How can I link the missing partials, (lostees or others)/trees/tree.html.haml to trees/tree.html.haml?
# config/routes.rb
namespace :lostees do
resources :islands
end
namespace :others do
namespace :users do
resources :clients do
scope 'applications', as: 'applications', klass: Application do
resources :submit_applications, only: [:update]
end
resources :applications
end
end
= form_for application, url: users_client_application_submit_application_path(client, application) do |f|
class Person < ActiveRecord::Base
attr_accessor :dont_set_name
def name
@name
end
def name=(attr)
@name = attr unless dont_set_name
end
@awilkening
awilkening / morse code converter
Created January 11, 2011 05:38
converts english into morse code
str = ''
counter = 1
ARGV.each do |a|
counter = counter + 1
a.each_char do |char|
char = char.to_s.downcase
case char
when 'a'
str += '.-'
when 'b'