Skip to content

Instantly share code, notes, and snippets.

@silasmontgomery
silasmontgomery / jquery.DyanmicElements.js
Created February 10, 2012 15:37
jQuery Plugin to Dyanmically Show/Hide, Enable/Disable, and Require/Not Elements based on Class names
/* Dynamic Elements v1.0
Show/hide, require/not require, and enable/disable fields based on checkboxes and select fields.
Class names: "lock" will disable an element, "hide" will hide an element, "need" will require an element.
Adding the ID of a checkbox as a class to an element will make it show/enabled/required:
i.e. <input type="checkbox" name="getName" id="getName" /> <input type="text" name="yourName" class="getName lock hide require" />
Adding the ID and value of a select field as a class to an element will make it show/enabled/required (format is 'ID-Value'):
i.e. <select name="getTitle" id="getTitle"><option>Mr</option><option>Mrs</option><option>Other</option> <input type="text" name="yourTitle" class="getTitle-Other lock hide require" />
@silasmontgomery
silasmontgomery / Pong_Forever.rb
Created January 23, 2012 03:25
Pong Clone - Ruby, Shoes, Hackety Hack!
# Pong Forever! (Pong Clone)
# Let the critiquing begin!
# Set element attributes
screen_width = 640
screen_height = 480
paddle_height = 80
paddle_width = 10
ball_diameter = 20
ball_speed = 2