- 6.1. Add Avo gem to Gemfile and run bundle install
- 6.2. Generate Avo configuration and initialize admin interface
- 6.3. Configure Avo resource for Authors with all social media fields
- 6.4. Configure Avo resource for Categories with hierarchical relationship management
- 6.5. Configure Avo resource for Tags with usage count display
- 6.6. Configure Avo resource for Resources with comprehensive field management
- 6.7. Configure Avo resource for ResourceRatings with moderation capabilities
- 6.8. Set up Avo filters for resource type, difficulty level, and status
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 'benchmark' | |
require 'benchmark/ips' | |
class TestClass | |
def initialize | |
@value = "test value" | |
end | |
def direct_access | |
@value |
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 'csv' | |
require 'time' | |
require 'set' | |
class Diff | |
MissingData = Data.define(:rows, :headers) | |
def initialize(source_file:, second_file:) | |
@source_file = source_file | |
@second_file = second_file |
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 Mastodon | |
ApiResponse = Data.define(:body, :headers, :code, :links) | |
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 | |
require "prism" | |
module RubyGems | |
module GemList | |
class Parser | |
def initialize(list, rubygems_client: RubyGems::Client.new) | |
@list = list | |
@rubygems_client = rubygems_client |
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 "prism" | |
class Parser | |
def initialize(list, rubygems_client: RubyGems::Client.new) | |
@list = list | |
@rubygems_client = rubygems_client | |
end | |
def parse | |
return parse_gemfile_format if gemfile_format? |
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 'socket' | |
class Handler | |
def initialize(port) | |
@server = TCPServer.new(port) | |
end | |
def start | |
loop do | |
client = @server.accept |
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 'dry/schema' | |
require 'dry/types' | |
class MyObject | |
def initialize(value) | |
@value = value | |
end | |
def value | |
return @value if @value.is_a?(Array) |
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 | |
require "benchmark" | |
require "benchmark/ips" | |
array = Array.new(1000) { Random.rand(100) }.sort | |
n = 50_000 | |
Benchmark.bmbm do |benchmark| | |
benchmark.report("bsearch") do |
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
# Code Summary | |
# 📖 https://paweldabrowski.com/articles/public-private-and-protected-in-ruby | |
# Part 1/5: Common way of defining private methods | |
class Person | |
def name; end | |
private | |
def age; end |
NewerOlder