Skip to content

Instantly share code, notes, and snippets.

View jhsu's full-sized avatar
💀
compliant with future standards

Joe Hsu jhsu

💀
compliant with future standards
  • MineHub
  • New York, NY
  • X @jhsu
View GitHub Profile
# Project Euler problem #8
# Find the greatest product of five consecutive digits in the 1000-digit number.
# This solution sorts each series of 5 digits by larger to lower digits (ie 54321) and and finds
# the largest number, since that would mean the series with the most larger numbers, then find the
# product of those digits. This is much more efficient than the one below.
# -- Joseph Hsu
long_number = <<NUMBER
73167176531330624919225119674426574742355349194934
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
@tmm1
tmm1 / gist:329682
Created March 11, 2010 21:31
EM Chat Server Demo
require 'rubygems'
require 'eventmachine'
require 'em-http' # gem install em-http-request
require 'yajl' # gem install yajl-ruby
class String
def bold
"\033[1m#{self}\033[0m"
end
end