Skip to content

Instantly share code, notes, and snippets.

View tinomen's full-sized avatar

Jake Mallory tinomen

  • Salt Lake City, UT
View GitHub Profile
@tinomen
tinomen / keybase.md
Created January 21, 2019 17:55
Keybase Public

Keybase proof

I hereby claim:

  • I am tinomen on github.
  • I am tinomen (https://keybase.io/tinomen) on keybase.
  • I have a public key ASB0B8kkPk2nQJXbR7OrRTI_B-84u6Luuz0qeOBQbXUWLgo

To claim this, I am signing this object:

@tinomen
tinomen / pos_fib_sum.txt
Created September 25, 2013 02:35
positive Fibonacci sum
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
Here is the ruby quiz
http://rubyquiz.strd6.com/quizzes/167-statistician-i
<p>Using <a href="http://projecteuler.net/project/names.txt">names.txt</a> (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names,
begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by
its alphabetical position in the list to obtain a name score.
</p>
<p>For example, when the list is sorted into alphabetical order, COLIN, which is worth 3 + 15 + 12 + 9 + 14 = 53, is the
938th name in the list. So, COLIN would obtain a score of 938 x 53 = 49714.
</p>
<p>What is the total of all the name scores in the file?</p>
@tinomen
tinomen / roman_numerals.txt
Created March 27, 2013 02:14
2013-03 slc.rb problem 2
Convert a number between 1 and 4999 (integer only) to the roman numeral representation.
make a command line program that takes 1 argument as a number and outputs the roman numerals.
An online converter is available at http://www.onlineconversion.com/roman_numerals_advanced.htm
@tinomen
tinomen / greatest_product.txt
Last active December 15, 2015 11:08
2013-03 slc.rb problem 1
Find the greatest product of five consecutive digits in the 1000-digit number.
Make a program that recieves a string of numbers (see below) and outputs the answer
73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
85861560789112949495459501737958331952853208805511
12540698747158523863050715693290963295227443043557
66896648950445244523161731856403098711121722383113
62229893423380308135336276614282806444486645238749
@tinomen
tinomen / mail.rb
Created September 8, 2011 05:44
basic mail smtp setup
# in enviornment.rb
config.after_initialize do
Mail.defaults do
delivery_method :smtp, { :address => "smtp.gmail.com",
:port => 587,
:domain => 'domain.com',
:from => 'no-reply@domain.com',
:user_name => 'no-reply@domain.com',
:password => 'secret',
:authentication => :login,
@tinomen
tinomen / Gemfile
Created June 29, 2011 01:26
goliath demo
source 'http://rubygems.org'
gem 'goliath', :git => 'https://github.com/postrank-labs/goliath.git'
gem 'yajl-ruby'
gem 'eventmachine', :git => 'git://github.com/eventmachine/eventmachine.git', :require => 'eventmachine'
gem 'em-http-request', :git => 'https://github.com/igrigorik/em-http-request.git'
gem "em-synchrony", :git => 'https://github.com/igrigorik/em-synchrony.git'
@tinomen
tinomen / Gemfile
Created June 22, 2011 04:51
example goliath app
source 'http://rubygems.org'
# gem 'goliath'
gem 'goliath', :git => 'https://github.com/postrank-labs/goliath.git'
gem 'em-http-request', '>= 1.0.0.beta.1'
# gem 'em-http-request', :git => 'https://github.com/igrigorik/em-http-request.git'
gem 'yajl-ruby'
group :development, :test do
@tinomen
tinomen / rails_logger.rb
Created May 25, 2011 16:44
changing the default rails logger
Rails::Initializer.run do |config|
log = Logger.new(File.dirname(__FILE__) + "/../log/#{RAILS_ENV}.log")
log.formatter = Logger::Formatter.new
log.level = (Services.env == 'production') ? Logger::INFO : Logger::DEBUG
log.datetime_format = "%Y-%m-%d %H:%M:%S "
config.logger = log
end