This file contains 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
# Calculate all the primes between 0 and the value specified | |
def primes(up_to) | |
prev = [] | |
(2..up_to).select do |x| | |
max_p = Math.sqrt(x).truncate | |
if !prev.find { |y| y <= max_p ? x % y == 0 : break } | |
prev << x | |
end | |
end | |
end |
This file contains 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
<html> | |
<head> | |
<title>Getting the gist of Gist</title> | |
</head> | |
<body> | |
like a fox | |
</body> | |
</html> |
NewerOlder