This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://documentcloud.github.io/underscore/underscore-min.js"></script> | |
<script src="http://documentcloud.github.io/backbone/backbone-min.js"></script> | |
<script src="http://code.jquery.com/jquery.min.js"></script> | |
<link href="http://getbootstrap.com/dist/css/bootstrap.css" rel="stylesheet" type="text/css" /> | |
<script src="http://getbootstrap.com/dist/js/bootstrap.js"></script> | |
<meta name="description" content="jsBin template - Backbone, Twitter Bootstrap" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$j.validator.addMethod("remote_data", function(value, element, params) { | |
var my_message = "some message"; | |
$j.ajax({ | |
... | |
}); | |
if (correct){ | |
return true; | |
} else { | |
$j.validator.messages.remote_data = my_message; | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo gem update rails | |
sudo gem update --system | |
sudo port install ruby19 +nosuffix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#my_radio_or_checkbox").attr("checked", "checked"); // check it | |
$("#my_radio_or_checkbox").removeAttr("checked"); // uncheck it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=> Booting Mongrel | |
=> Rails 2.3.5 application starting on http://0.0.0.0:3000 | |
/opt/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement | |
/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:142:in `named_helper_module_eval': (eval):3:in `named_helper_module_eval': compile error (SyntaxError) | |
(eval):1: syntax error, unexpected ':', expecting '\n' or ';' | |
... def hash_for_username:strings_path(options = nil) ... | |
^ | |
(eval):3: syntax error, unexpected kEND, expecting $end | |
end ... | |
^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rails-template.rb | |
# by Marcin Nowakowski (mymanufactory.com) | |
#------------------------- | |
# Plugins and Gems | |
#------------------------- | |
plugin 'rspec', :git => 'git://github.com/dchelimsky/rspec.git' | |
plugin 'rspec-rails', :git => 'git://github.com/dchelimsky/rspec-rails.git' | |
plugin 'exception_notifier', :git => 'git://github.com/rails/exception_notification.git' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// convert some user ID (int) in to special unique hex color | |
function convertIdToHex(val:int):String{ | |
return '#' + ('00000' + (val * 999999).toString(16).toUpperCase()).substr(-6); | |
} | |
trace(convertIdToHex(1)) | |
trace(convertIdToHex(2)) | |
trace(convertIdToHex(3)) | |
trace(convertIdToHex(4)) | |
trace(convertIdToHex(5)) |