DEV Community

loading...
Seiei Miyagi profile picture

Seiei Miyagi

こんにちは

Location Naha, Okinawa Joined Joined on  Personal website https://www.hanach.in/ github website twitter website

All 41 comments

Daily Challenge #40 - Counting Sheep

Sadly, pipeline operator is reverted. github.com/ruby/ruby/...

Daily Challenge #51 - Valid Curly Braces

ruby <3 def areCurlyBracesMatched(s) s.match?(/\A(?&...

Daily Challenge #49 - Dollars and Cents

ruby <3 define_method(:format_dollar, &"$%.02f".:%...

Daily Challenge #48 - Facebook Likes

I can't wait ruby 2.7 release! git clone git@github.com:r...

Daily Challenge #48 - Facebook Likes

ruby <3 def likes(ls) case ls in [] "no one li...

Daily Challenge #46 - ???

I see. Also % literal is my favorite string literal :) s ...

Daily Challenge #47 - Alphabets

ruby <3 def alphabet_position(s) pos = (?a..?z |>...

Daily Challenge #46 - ???

I love weird Ruby syntax😆 TIPS: ?? is known as character l...

Daily Challenge #46 - ???

ruby <3 def remove_question_marks(s) s |> delete ...

Daily Challenge #45 - Change Machine

ruby <3 def change(amount) result = { 25 => 0, 10...

Daily Challenge #44 - Mexican Wave

ruby <3 def wave(s) s.size.times.filter_map { |i| s[...

Reverted Ruby 2.7 new feature: Method reference operator

My understanding is, experimental mean the behavior may cha...

Daily Challenge #42 - Caesar Cipher

ruby <3 def decrypt_caesar_cipher(s, shift) decrypte...

Daily Challenge #43 - Boardgame Fight Resolver

ruby <3 Swordsman, Cavalry, Archer, Pikeman = :swardsm...

Daily Challenge #40 - Counting Sheep

Yes! pipeline operator added. Feature #15799: pipeline ope...

Daily Challenge #41 - Greed is Good

ruby <3 def score(values) values.tally.sum do |n, cn...

Daily Challenge #40 - Counting Sheep

ruby <3 def count_sheep(n) 1..n |> map { "#@1 she...

Daily Challenge #39 - Virus

After a day, I feel def cure is better,

Daily Challenge #39 - Virus

Yes! I love to try new syntax😆 So I use 2.7 in #challenge t...

Daily Challenge #39 - Virus

ruby <3 def antivirus(s) s |> downcase |> gsub...

Daily Challenge #38 - Middle Name

ruby <3 def initialize_middle_name(n) n.split.then {...

Daily Challenge #37 - Name Swap

ruby 2.7 def nameShuffler(s) s |> split ' ', 2 |>...

Daily Challenge #36 - Let's go for a run!

Ruby <3 def runningPace(d, t) t.split ?: |> map &...

Daily Challenge #35 - Find the Outlier

ruby 2.7 def findOutlier(a) a.group_by(&:even?).each_...

Daily Challenge #34 - WeIrD StRiNg CaSe

I'm glad to hear that. Enumerable has so many methods, whic...

Daily Challenge #34 - WeIrD StRiNg CaSe

def to_weird_case(s) s.split(' ').map { @1.chars.map.with_i...

Project Euler #6 - Sum Square Difference

Ruby 2.7 p (1..100).then { @1.sum ** 2 - @1.sum { @1 ** ...

How to minimize RSpec `describe`/`context` nesting

I don't necessarily think it's as bad as your colleagues do ...

Ruby 2.6 new feature: refine `#to_proc`

140% symbols😋🍭 map(&o.:[]) ( & . : [ ] ) ...

Reverted Ruby 2.7 new feature: Method reference operator

In other programming languages, they have more convenient w...

Reverted Ruby 2.7 new feature: Method reference operator

That's my example's problem. Many other real world use-cas...

Ruby 2.6 new feature: refine `#to_proc`

That's correct! & would implicitly call #to_proc to conv...

Reverted Ruby 2.7 new feature: Method reference operator

Updated the code, Thanks for improvements!

Project Euler #3 - Largest Prime Factor

It returns 2 when n = 1, my code returns nil.

Project Euler #1 - Multiples of 3 and 5

Ruby✨💎✨ require "set" multiples_of_3 = Enumerator.new {...

Project Euler #3 - Largest Prime Factor

Ruby✨💎✨ require "prime" puts Enumerator.new { |y| n = 60...

Project Euler #2 - Even Fibonacci numbers

Ruby✨💎✨ puts Enumerator.new { |y| f1, f2 = 0, 1 f1, ...

Write a script to find permutable prime numbers

Ruby✨💎✨ require 'prime' require 'set' Prime.take_while ...

Help Me Refactor dev.to's Markdown Service!

refine the String class then just chaining methods at fix_a...

Ordering Hash in Ruby

I just update the article added a micro benchmark result.

Lazy FizzBuzz

Awesome! zipping infinite generators is really cool👍 Tips:...

loading...