Skip to content

Instantly share code, notes, and snippets.

Avatar

Scott Meves stereoscott

View GitHub Profile
@xdite
xdite / 42-things.md
Created Jul 14, 2012
Ten (42) Things You Didn't Know Rails Could Do
View 42-things.md
@aganov
aganov / datetime_ui_input.rb
Created Oct 4, 2011
Formtastic jQuery UI date and time picker input
View datetime_ui_input.rb
# http://jqueryui.com/demos/datepicker/
# http://fgelinas.com/code/timepicker/
class DatetimeUiInput
include Formtastic::Inputs::Base
DATE_FORMAT = "%Y-%m-%d"
TIME_FORMAT = "%H:%M"
def to_html
View jQuery HTML5 placeholder fix.js
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);