Skip to content

Instantly share code, notes, and snippets.

View benphelps's full-sized avatar
🇺🇦
Slava Ukrayini!

Ben Phelps benphelps

🇺🇦
Slava Ukrayini!
View GitHub Profile
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
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>'
req = Net::HTTP::Post.new(url.request_uri)
req.use_ssl = true
List of available fields:
52HIGH
52LOW
ASK
ASKX
ASK_SIZE
AX
BACK_EX_MOVE
BACK_VOL
BA_SIZE
new(delay: p[:delay], status: p[:status], timestamp: n, (p[:status] != 'OK' ? error: p[:message] : error: nil))
window.setInterval(function() {
$.ajax({
type: 'GET',
url: "/response",
dataType: "json",
timeout: 60,
context: $('body'),
success: function(payload){
/*
$.each(messages, function(data){
:""
:"<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"
:handle_arguments
:ConfigFile
:add_dependency_with_type
:link
:proc_or_lambda
:executables=
:fu_stat_identical_entry?
:check_password
:resolve_file
:homepage
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);
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