This file contains hidden or 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
class EmailValidator < ActiveModel::EachValidator | |
def validate_each(record, attribute, value) | |
unless value =~ /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i | |
record.errors[attribute] << (options[:message] || "is not an email") | |
end | |
end | |
end | |
class Person < ActiveRecord::Base | |
validates :email, :presence => true, :email => true |
This file contains hidden or 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
Password: | |
/Users/phelpsb/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find god (>= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.5.4, minitest-2.5.1, rake-0.9.2.2, rdoc-3.9.4] (Gem::LoadError) | |
from /Users/phelpsb/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec' | |
from /Users/phelpsb/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem' | |
from /Users/phelpsb/.rvm/gems/ruby-1.9.3-p194/bin/god:18:in `<main>' | |
from /Users/phelpsb/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval' | |
from /Users/phelpsb/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>' |
This file contains hidden or 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
req = Net::HTTP::Post.new(url.request_uri) | |
req.use_ssl = true | |
This file contains hidden or 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
List of available fields: | |
52HIGH | |
52LOW | |
ASK | |
ASKX | |
ASK_SIZE | |
AX | |
BACK_EX_MOVE | |
BACK_VOL | |
BA_SIZE |
This file contains hidden or 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
new(delay: p[:delay], status: p[:status], timestamp: n, (p[:status] != 'OK' ? error: p[:message] : error: nil)) |
This file contains hidden or 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
window.setInterval(function() { | |
$.ajax({ | |
type: 'GET', | |
url: "/response", | |
dataType: "json", | |
timeout: 60, | |
context: $('body'), | |
success: function(payload){ | |
/* | |
$.each(messages, function(data){ |
This file contains hidden or 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
:"" | |
:"<IFUNC>" | |
:"<CFUNC>" | |
:respond_to? | |
:"core#set_method_alias" | |
:"core#set_variable_alias" | |
:"core#undef_method" | |
:"core#define_method" | |
:"core#define_singleton_method" | |
:"core#set_postexe" |
This file contains hidden or 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
:handle_arguments | |
:ConfigFile | |
:add_dependency_with_type | |
:link | |
:proc_or_lambda | |
:executables= | |
:fu_stat_identical_entry? | |
:check_password | |
:resolve_file | |
:homepage |
This file contains hidden or 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
package me.benphelps.Plots; | |
import org.bukkit.plugin.java.JavaPlugin; | |
public class Plots extends JavaPlugin { | |
public boolean creating; | |
public void onEnable(){ | |
getServer().getPluginManager().registerEvents(new PlotsBlockListener(this), this); |
This file contains hidden or 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
class ArmorTier < ActiveRecord::Base | |
attr_accessible :agility, :deviation, :intellect, :level, :name, :stamina, :strength | |
belongs_to :armor_material | |
def agility | |
self.agility + rand(deviation) | |
end | |
end |