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
| config.autoload_paths << Rails.root.join('lib') | |
| config.autoload_paths += Dir["#{config.root}/lib/**/"] |
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
| import Vue from 'vue' | |
| import upperFirst from 'lodash/upperFirst' | |
| import camelCase from 'lodash/camelCase' | |
| const requireComponent = require.context( | |
| '@/components', true, /\.vue$/ | |
| ) | |
| requireComponent.keys().forEach(fileName => { | |
| const componentConfig = requireComponent(fileName) |
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 Rabbit | |
| attr_accessor :status, :payload | |
| def initialize(status, payload) | |
| self.status = status | |
| self.payload = payload | |
| end | |
| def call |
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
| # ruby 2.6.3 | |
| # | |
| class Crypto | |
| def initialize(method, string, count) | |
| @method = method | |
| @string = string | |
| @count = count | |
| 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
| # ruby 2.6.3 | |
| # | |
| class Crypto | |
| def initialize(method, string, count) | |
| @method = method | |
| @string = string | |
| @count = count | |
| 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
| def parse(text) | |
| arr = text.split(/[,.!? ]/).reject(&:empty?) | |
| a = arr.map(&:downcase).each_with_object(Hash.new(0)) do |k, v| | |
| v[k] += 1 | |
| end | |
| return [] if a.count < 3 | |
| p a.sort_by { |_, v| v }.reverse[0...3] | |
| 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
| snake_case_modify = ->(string) { string.nil? ? nil : string&.gsub(/[^a-zA-Z]/, "_")&.downcase } |
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
| namespace :db do namespace :seed do | |
| Dir[Rails.root.join('db', 'seeds', '*.rb')].each do |filename| | |
| task_name = File.basename(filename, '.rb') | |
| desc "Seed #{task_name}, based on the file with the same name in `db/seeds/*.rb`" | |
| task task_name.to_sym => :environment do | |
| load(filename) if File.exist?(filename) | |
| end | |
| end | |
| 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
| rescue => error | |
| Rails.logger.error(error) | |
| Rails.logger.error(error.message) | |
| Rails.logger.error(error.backtrace.join("\n")) |
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
| echo "==========================================" | |
| echo "Set ssh id_rsa(sample desc)" | |
| echo "==========================================" | |
| git config --global --replace-all user.email "[email protected]" | |
| git config --global --replace-all user.name "GITHUB NAME" | |
| echo "------------------------------------------" | |
| echo "User creds" | |
| git config --global user.email | |
| git config --global user.name |
OlderNewer