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
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
# 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
# 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
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
config.autoload_paths << Rails.root.join('lib') | |
config.autoload_paths += Dir["#{config.root}/lib/**/"] |
NewerOlder