Hash[*{:a => "a", :b => "thisisb", :c => "c", :d => "thiswasb", :e => "34" }.collect { |k, v|
	[k, v] if [:a, :b, :c].include?(k)
}.compact.flatten]

Ruby On Passing hashed arguments

by Vanson Samuel, May 21, 2010 02:36
9fe6d04c7c6a357a92a2b05efd0d09bc Talk
class RetryLoop
  # This method will attempt to run the passed block retry_num times.
  # If the block returns false on a run it will simply go to the next
...

Ruby On Retry Loop

by Vanson Samuel, April 26, 2010 01:54

How about this?

9fe6d04c7c6a357a92a2b05efd0d09bc Talk
/* Expecting inputs to have the following attributes: class, initialValue, and actualType
 * Searches for inputs with the class set to resetting_inputs and sets them to an initial text value of initialValue
 * On click blanks out the input and sets the type to actualType
...

JavaScript On Prototype form functions

by Vanson Samuel, March 29, 2009 18:46 Star_fullStar_fullStar_fullStar_full
9fe6d04c7c6a357a92a2b05efd0d09bc Talk