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
/*! debug.css | MIT License | zaydek.github.com/debug.css */ | |
*:not(path):not(g) { | |
color: hsla(210, 100%, 100%, 0.9) !important; | |
background: hsla(210, 100%, 50%, 0.5) !important; | |
outline: solid 0.25rem hsla(210, 100%, 100%, 0.5) !important; | |
box-shadow: none !important; | |
} |
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
require_relative 'postman/email_base' | |
require_relative 'postman/mail_gun_postman' | |
require_relative 'postman/custom_sms_gateway' | |
module Janao | |
module Postman | |
# Sets list of allowed email adapters | |
EMAIL_ADAPTERS = { | |
'MailGun' => MailGunPostman |
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
Homebrew build logs for qt on macOS 10.14 | |
Build date: 2018-10-07 16:01:34 |
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
require: rubocop-rspec | |
Rails: | |
Enabled: true | |
# Commonly used screens these days easily fit more than 80 characters. | |
Metrics/LineLength: | |
Max: 120 | |
# Too short methods lead to extraction of single-use methods, which can make |
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
# Original AFooClass | |
class AFoo | |
def bar | |
puts "Foooo Bar" | |
end | |
end | |
# Refining Module | |
module RefiningAFoo |
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
module ActiveModel | |
class Errors | |
attr_accessor :error_code, :developer_message, :more_info | |
def add(attribute, message = :invalid, options = {}) | |
options.each { |k,v| instance_variable_set("@#{k}", v) } | |
message = normalize_message(attribute, message, options) | |
if exception = options[:strict] |
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
# Module MixArrayFlattener | |
# Add #flatten_array to Array for the purpose | |
# of flatten nested array | |
module MixArrayFlattener | |
InvalidArrayItemFound = Class.new(StandardError) | |
# Flatten nested array! | |
# | |
# @return single flat array, |
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
class AlterUser < ActiveRecord::Migration | |
def up | |
rename_table :users, :customers | |
add_column :customers, :username, :string, limit: 25 | |
change_column :customers, :email, :string, limit: 100 | |
rename_column :customers, :password, :hashed_password | |
add_column :customers, :salt, :string, limit: 40 | |
add_index :customers, :username | |
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
class OrderService | |
class << self | |
def find_or_create_purchase_for_order(order, credit_card_id, shipping_fee = 0.0) | |
buyer, seller, purchase, s_state = order.buyer, order.seller, Purchase.find_by_user_id_and_order_id(user.id, order.id), order.cart.shipping_address.state.upcase | |
sale_tax = SalesTax.find_by_user_id(vendor.id).send(s_state) rescue 0.0 | |
total_chargeable_amount = calculate_total order.price, sale_tax, vendor.reppio_cut | |
create_purchase order, credit_card_id, shipping_fee, total_chargeable_amount, sales_tax # updated here |
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
# the day_statistics | |
include Mongoid::Document | |
field :date, type: Date | |
field :entity_id, type: Integer | |
field :todays_statistics, type: Hash | |
field :hotel_inventory, type: Hash |
NewerOlder