Skip to content

Instantly share code, notes, and snippets.

@mikeadeleke
mikeadeleke / gist:8014624
Last active December 31, 2015 16:39
99 bottles
def bottle_song(i)
while i > 2
puts "#{i} bottles of beer on the wall, #{i} bottles of beer. "
puts "Take one down, pass it around, #{i - 1} bottles of beer on the wall!"
i = i - 1
end
puts "2 bottles of beer on the wall, 2 bottles of beer."
puts "Take one down, pass it around. 1 bottle of beer on the wall!"
puts "1 bottle of beer on the wall, 1 bottle of beer."
puts "Take one down, pass it around. No more bottles of beer on the wall!"
@mikeadeleke
mikeadeleke / gist:8125812
Created December 25, 2013 18:42
Tip Calculator
puts "Enter the price of your meal before tax"
meal = Float(gets)
puts "What is the tax rate in your area?"
tax = Float(gets)
puts "What is the tip rate in your area?"
tip = Float(gets)
def calculate(base, percent)
amount = base * percent / 100
end
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
</body>
</html>
@mikeadeleke
mikeadeleke / gist:9406134
Last active August 29, 2015 13:57
Domi next features
To do
- Make mockups
- Make users flows
Next
- Add the ability to schedule a showing
- add map for location (https://github.com/alexreisner/geocoder)
- add messaging
- add users requesting a place
- implement dashboard
@mikeadeleke
mikeadeleke / gist:9624735
Created March 18, 2014 17:19
Domi Rspec Tests
#show.html.erb for Appointments
<p><%= @appointment.time %></p>
<p><%= @appointment.listing.property.address %></p>
<p>Comments</p>
<% @appointment.comments.each do |comment| %>
<%= comment.comment %>
<% end %>
@mikeadeleke
mikeadeleke / gist:9753180
Created March 25, 2014 00:56
Carrierwave multiple file uploads
<%= nested_form_for @property, :html=> {:multipart => true } do |f| %>
......
<div class="field">
<%= f.fields_for :images do |image_form| %>
<%= image_form.file_field :photo %>
<a><%= image_form.link_to_remove "Remove this attatchment" %></a>
<% end %>
<%= f.link_to_add "Add photo", :images %>
</div>
.......
@mikeadeleke
mikeadeleke / gist:9821724
Created March 27, 2014 23:44
Twilio Phone Number model
# Twilio_Phone_Number_Table
# id number active(boolean)
# 1 423-123-1233 0
# 2 423-123-1233 1
# Listing Table (has many appointments)
# lister_id status
# Appointment Table
@mikeadeleke
mikeadeleke / gist:9881253
Created March 30, 2014 22:47
Domi beta launch clean up
Clean up:
- share buttons and links
- Home page button
- overall issues
- Email
@mikeadeleke
mikeadeleke / gist:9914389
Last active August 29, 2015 13:57
Todos and Issues
Issues
- Invite friends via facebook
Todos
- Test suite
_ Email for IOS and Rails people
- Get a freelance photographer
- New demo video
- How to videos for doing a specific action
@mikeadeleke
mikeadeleke / index.html.erb
Created April 19, 2014 16:08
Wizpert-Michael
<script type="text/javascript">
navigator.geolocation.getCurrentPosition(GetLocation);
function GetLocation(location) {
alert(location.coords.latitude);
alert(location.coords.longitude);
alert(location.coords.accuracy);
}
</script>