Skip to content

Instantly share code, notes, and snippets.

View falonofthetower's full-sized avatar

Peter Karth falonofthetower

  • CompanyCam
  • Sanford, NC
View GitHub Profile
# The following formula is used to calculate the fixed monthly payment
# (payment) required to fully amortize a loan of "loan" dollars over a term of
# "duration" months at a monthly interest rate of "interest".
# [If the quoted rate is 6%, for example, "interest" is .06/12 or .005]
def fixed_monthly_payment(loan, interest, duration)
payment = loan * (interest * (1 + interest)**duration) / ((1 + interest)**duration - 1)
payment.round(2)
end
def number?(number)
set nocompatible
filetype off
if has("autocmd")
filetype indent plugin on
endif
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#rc()
set tags+=gems.tags
def spacer
puts "------------------------------------------------------------------------------------"
end
def blank
puts ""
end
puts "the string method"
blank
Style/MethodCallParentheses:
Enabled: false
Description: 'Do not use parentheses for method calls with no arguments.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
Style/BracesAroundHashParameters:
Enabled: false
EnforcedStyle: no_braces
SupportedStyles:
# The `braces` style enforces braces around all method parameters that are
<!doctype html>
<html lang="en-US">
<head>
<title></title>
<meta charset="UTF-8" />
</head>
<body>
</body>
</html>
class Series
def initialize(string)
@string = string
end
def string_to_array
@string.split('').map(&:to_i)
end
def fetch_slices(size, string_array)
guard :minitest do
watch(%r{^(.*)\/?test_(.*)\.rb$})
watch(%r{^(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
watch(%r{^test_helper\.rb$}) { 'test' }
end
source 'https://rubygems.org'
group :development do
gem 'guard'
gem 'guard-minitest'
end
set nocompatible
filetype off
if has("autocmd")
filetype indent plugin on
endif
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#rc()
set tags+=gems.tags
class Board
def self.transform(board)
@rows = []
explode_rows(board)
validate_rows
process_rows
reform_rows
end
def self.validate_rows