Skip to content

Instantly share code, notes, and snippets.

View gicappa's full-sized avatar
🏠
Working from home

Gian Carlo Pace gicappa

🏠
Working from home
  • Hyland / Alfresco
  • Gallarate, VA
  • X @gicappa
View GitHub Profile
@gicappa
gicappa / gist:8684952
Created January 29, 2014 10:03
OutputCrpError
1 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration boolean -> org.hibernate.type.BooleanType@712a95c7
2 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration boolean -> org.hibernate.type.BooleanType@712a95c7
3 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration java.lang.Boolean -> org.hibernate.type.BooleanType@712a95c7
5 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration numeric_boolean -> org.hibernate.type.NumericBooleanType@563afc0c
7 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration true_false -> org.hibernate.type.TrueFalseType@5063b8c1
8 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration yes_no -> org.hibernate.type.YesNoType@4a2c1b1c
10 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding type registration byte -> org.hibernate.type.ByteType@7ec77512
10 [main] DEBUG org.hibernate.type.BasicTypeRegistry - Adding
@gicappa
gicappa / 0_reuse_code.js
Created January 22, 2014 23:44
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@gicappa
gicappa / custom_validator.rb
Created July 11, 2011 13:02
Custom validator
# encoding: UTF-8
module ActiveModel
# == Active Model Exclusion Validator
module Validations
class VersionValidator < EachValidator
def validate_each(record, attribute, value)
record.errors.add(attribute, "Non può essere vuoto") if value.nil? or value.strip.empty?
record.errors.add(attribute, "La version non è espressa nel formato 2.3.4") unless value =~ /\b\d+\.\d+\.\d+\b/
end
end