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
| // ---- | |
| // Sass (v3.2.19) | |
| // Compass (v0.12.6) | |
| // ---- | |
| $price_classes: (p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, pc, s0, s1, s2, s3, s4, s5, s6, s7, s8, s9) | |
| $price_small: ((0px -122px, 20px, 42px, -5px), (-44px -122px, 13px, 42px, -7px), (-85px -122px, 14px, 42px, -6px), (-129px -122px, 20px, 42px, -6px), (-174px -122px, 20px, 42px, -11px), (-222px -122px, 18px, 42px, -8px), (-269px -122px, 19px, 42px, -9px), (-311px -122px, 16px, 42px, -12px), (-358px -122px, 14px, 42px, -7px), (-404px -122px, 15px, 42px, -6px), (-453px -127px, 1px, 42px, -1px), (-4px -179px, 9px, 42px, -8px), (-38px -179px, 9px, 42px, -11px), (-79px -179px, 8px, 42px, -8px), (-117px -179px, 10px, 42px, -10px), (-164px -179px, 9px, 42px, -8px), (-214px -179px, 6px, 42px, -6px), (-261px -179px, 6px, 42px, -6px), (-308px -179px, 4px, 42px, -5px), (-355px -179px, 7px, 42px, -6px), (-400px -179px, 7px, 42px, -5px)) | |
| $price_big: ((0px 0px, 30px, 61px, -5px), (-49px 0px, 32px, 61px, -7px), (-89px 0px, 44px, 61px, -7px), (-138px 0px, 40px, 61p |
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 Protocol | |
| attr_reader :name, :ancestors | |
| def initialize(name, ancestors, block) | |
| @name = name | |
| @ancestors = ancestors | |
| @methods = [] | |
| instance_exec(&block) | |
| end | |
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 TrueClass | |
| def choose(if_true, if_false) | |
| if_true | |
| end | |
| end | |
| class FalseClass | |
| def choose(if_true, if_false) | |
| if_false | |
| end |
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
| Calendar = Class.create({ | |
| MONTHS : ["gennaio", "febbraio", "marzo", "aprile", "maggio", "giugno", "luglio", "agosto", "settembre", "ottobre", "novembre", "dicembre"], | |
| DAYS : ["dom", "lun", "mar", "mer", "gio", "ven", "sab"], | |
| MONTH_DAYS : [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], | |
| year : null, | |
| month : null, | |
| specialDates : null, | |
| initialize : function(_special) { |
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
| require "json" | |
| require "open-uri" | |
| require "optparse" | |
| require "fileutils" | |
| require "cgi" | |
| class FriendfeedExporter | |
| attr_reader :all_entries | |
| def initialize(options) |
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 ActiveSupport::TestCase | |
| class << self | |
| def context(name, &block) | |
| _context_stack_.unshift name.gsub(/\s+/,'_') | |
| define_callbacks :"setup_#{_current_context_}", :"teardown_#{_current_context_}" | |
| class_eval(&block) | |
| _context_stack_.pop | |
| end | |
| def test_with_context(name, &block) |
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
| module Decorating | |
| def decorate(meth_id, *modules) | |
| alias_method("__#{meth_id}__", meth_id) | |
| define_method(meth_id) do |*args| | |
| result = send("__#{meth_id}__", *args) | |
| modules.each { |m| result.extend(m) } | |
| return result | |
| end | |
| end | |
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
| require "digest/sha1" | |
| module AuthenticationModel | |
| def self.included(base) | |
| base.send(:include, InstanceMethods) | |
| base.send(:extend, ClassMethods) | |
| base.send(:validates_presence_of, :email, :message => "L'indirizzo email è richiesto.") | |
| base.send(:validates_presence_of, :password, :if => :password_required?, :message => "La password è richiesta.") | |
| base.send(:validates_uniqueness_of, :email, :case_sensitive => false, :message => "Questo indirizzo email è già presente.") |
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 Aif | |
| def initialize(cond) | |
| @cond = cond | |
| end | |
| def else | |
| yield unless @cond | |
| end | |
| end | |
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
| require "thread" | |
| module Synchronization | |
| class Proxy | |
| instance_methods.each { |m| undef_method m unless m =~ /^__|extend/ } | |
| def initialize(target) | |
| @__target__ = target | |
| end | |