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 "pry-byebug" | |
| require "openssl" | |
| require "jwt" | |
| require "securerandom" | |
| priv_key = File.open("path/to/private/key") do |f| | |
| OpenSSL::PKey.read(f.read) | |
| end | |
| payload = { |
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
| ActiveRecord::Delegation.delegate :as_csv, to: :records | |
| class Hash | |
| def as_csv | |
| values | |
| end | |
| end | |
| class Object | |
| def as_csv(options = nil) #:nodoc: |
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 "pry-byebug" | |
| require "openssl" | |
| require "jwt" | |
| require "securerandom" | |
| priv_key = File.open(ENV.fetch("IDENT_PRIV_KEY")) do |f| | |
| OpenSSL::PKey.read(f.read) | |
| end | |
| profile = { |
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
| # frozen_string_literal: true | |
| class RemoveLegacyUsers < ActiveRecord::Migration[6.0] | |
| def change | |
| add_index :asset_proposals, %i[code owner_id], unique: true | |
| add_index :asset_proposals, %i[contract_address owner_id], unique: true | |
| 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
| {{/* vim: set filetype=mustache: */}} | |
| {{/* | |
| Expand the name of the chart. | |
| */}} | |
| {{- define "applogic.name" -}} | |
| {{- printf "applogic" -}} | |
| {{- 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
| module MyApp | |
| def config | |
| Config.instance | |
| end | |
| class Config | |
| include Singleton | |
| attr_reader :env |
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
| RPM_TO_SPEED_MULTIPLIER = 10 | |
| class Tire | |
| def initialize(producer:, diameter:) | |
| @producer = producer | |
| @diameter = diameter | |
| @dirty = [true, false].sample | |
| end | |
| def dirty |
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
| D, [2019-08-31T15:55:06.908599 #45740] DEBUG -- : Trade Load (1.1ms) SELECT `trades`.* FROM `trades` ORDER BY `trades`.`id` ASC LIMIT 1 | |
| D, [2019-08-31T15:55:06.908599 #45740] DEBUG -- : ↳ lib/tasks/kafka.rake:38 | |
| D, [2019-08-31T15:55:06.930825 #45740] DEBUG -- : Market Load (1.2ms) SELECT `markets`.* FROM `markets` WHERE `markets`.`id` = 'btcusd' | |
| D, [2019-08-31T15:55:06.930961 #45740] DEBUG -- : ↳ lib/tasks/kafka.rake:38 | |
| D, [2019-08-31T15:55:06.949899 #45740] DEBUG -- : Member Load (2.0ms) SELECT `members`.* FROM `members` WHERE `members`.`id` = 57 | |
| D, [2019-08-31T15:55:06.950030 #45740] DEBUG -- : ↳ lib/tasks/kafka.rake:38 | |
| D, [2019-08-31T15:55:06.960981 #45740] DEBUG -- : Order Load (1.4ms) SELECT `orders`.* FROM `orders` WHERE `orders`.`id` = 1791 | |
| D, [2019-08-31T15:55:06.961084 #45740] DEBUG -- : ↳ lib/tasks/kafka.rake:38 | |
| D, [2019-08-31T15:55:06.987764 #45740] DEBUG -- : Member Load (1.6ms) SELECT `members`.* FROM `members` WHERE `members`.`id` = 57 | |
| D, [2019-08-31T15:55:06.987868 #45740] |
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
| squad = %w[Ania Dania Andrey Anton Pasha] | |
| squad.shuffle | |
| .append(squad.sample) | |
| .each_slice(2) { |f, s| pp "#{f} and #{s}"} |
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
| CURRENCY_PARAMS = { | |
| name: { desc: -> { API::V2::Admin::Entities::Currency.documentation[:name][:desc] } }, | |
| deposit_fee: { | |
| type: { value: BigDecimal, message: 'admin.currency.non_decimal_deposit_fee' }, | |
| values: { value: -> (p){ p >= 0 }, message: 'admin.currency.invalid_deposit_fee' }, | |
| desc: -> { API::V2::Admin::Entities::Currency.documentation[:deposit_fee][:desc] }, | |
| default: 0.0 | |
| } | |
| #... | |
| } |