Skip to content

Instantly share code, notes, and snippets.

@jvenator
jvenator / homework_test_2.rb
Created October 17, 2012 21:34
Joseph D. - Flatiron Homework
# some more homework material
@jvenator
jvenator / gist:3907908
Created October 17, 2012 20:21
10_17_12 - song_library.rb
def assert_equal(actual, expected)
if expected == actual
puts 'pass'
else
puts "fail: expected #{expected}, got #{actual}"
end
end
def assert(statement)
if statement
<section id="links" class = "link" align="center">
<div class="center">
<h2 class="title"><span>Coder Cred</span></h2>
</div>
<div class="coder-cred center">
<ul>
<li class="github"><a href="http://github.com/##"></a></li>
<li class="codeschool"><a href="http://www.codeschool.com/users/##" ></a></li>
<li class="coderwall"><a href="https://coderwall.com/##" ></a></li>
<li class="stackoverflow"><a href="http://stackoverflow.com/users/1496757/##" ></a></li>
h1 {
font-size: 3em;
}
div#right_col{
width: 212px;
}
div#right_col img {
border: 6px solid #403051;
@jvenator
jvenator / gist:2008472
Created March 9, 2012 20:21
packages/documents_controller options
class Packages::DocumentsController < ApplicationController
def create
@package = Package.find(params[:package_id])
Document.where(:id => params[:id].split(",")).each do |d|
@package.add_document(d)
end
@documents = Document.where(:id => params[:id].split(",")).collect do |d|
@package.add_document(d)
end
def destroy
@jvenator
jvenator / gist:1588334
Created January 10, 2012 10:12
Leveraged Returns In Real Estate Explained
One way to achieve higher investment returns in real estate is to use leverage or debt. It can allow one to
achieve significantly higher returns, and place most of the downside risk on lender. However, it makes the
investment return more sensitive to changes in the property’s financial performance.
Let’s consider a property that is purchased for $10.0 million and has NOI of $800k
(net operating income = revenue – expenses excl. debt). If the purchase is all cash,the annual return
(aka – cash on cash) is 8.0% ($800k / $10.0M = 8.0%). If the buyer gets a loan at 80% LTV (loan to value)
or $8.0M with a 7% interest rate ($560k). the property still throws off $800k in NOI but has a $560k debt
payment. This leaves $240k, however, she only invested $2.0M in cash because of the 80% loan. This equates
to a leveraged return of 12.0% for the buyer ($240k / $2.0M = 12.0%). We see that because the borrowing rate