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
" Please go through Readmine for every plugin and add needed configuration | |
Plug 'itchyny/lightline.vim' | |
Plug 'airblade/vim-gitgutter' | |
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } | |
Plug 'junegunn/fzf.vim' | |
Plug 'tpope/vim-endwise' | |
Plug 'tpope/vim-rails' | |
Plug 'ngmy/vim-rubocop' | |
Plug 'vim-ruby/vim-ruby' |
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
name: Verify Licenses | |
on: [push] | |
jobs: | |
licenses: | |
name: Verify Gem Licenses | |
runs-on: ubuntu-latest |
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
sources: | |
bundler: true | |
npm: true | |
allowed: | |
- mit | |
- apache-2.0 | |
- bsd-2-clause | |
- bsd-3-clause | |
- isc |
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 WithInstanceMethod | |
def whoami | |
puts self.inspect | |
end | |
end | |
class One | |
include WithInstanceMethod | |
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
# nil and Truthy => nil | |
x = nil | |
y = Object.new | |
puts "when x=#{x.class} and y=#{y.class} then x && y returns #{(x && y).inspect} => x" | |
x = nil | |
y = true | |
puts "when x=#{x.class} and y=#{y.class} then x && y returns #{(x && y).inspect} => x" | |
# nil and falsy => nil |
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 |
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
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
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 "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? |