My Little Garden of Code

bloggings about codings

First Post

| Comments

This is my GitHub blog.

Here’s a test code snippet:

Discover if a number is prime
1
2
3
4
5
class Fixnum
  def prime?
    ('1' * self) !~ /^1?$|^(11+?)\1+$/
  end
end

Test Gist embedding:

Comments