Skip to content

Instantly share code, notes, and snippets.

@mikeadeleke
mikeadeleke / gist:59519ca92f702a188394
Created June 5, 2014 16:24
Rake tasks, automated emails, and whenever gem
email_reminders.rake
namespace :email_reminders do
desc "reminds the user to complete their profile"
task :founder_welcome => :environment do
if Rails.env == "production"
if @user.profile.present?
ConfirmMailer.founder_welcome(@user).deliver
end
end
@mikeadeleke
mikeadeleke / gist:87426050a6bc9f7602d0
Last active August 29, 2015 14:01
Effed up Mailers
Error: https://www.dropbox.com/s/r3n2dfit5i3hg9e/Screenshot%202014-05-18%2019.47.07.png
production.rb
Domimvp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
config.eager_load = true
config.consider_all_requests_local = false
@mikeadeleke
mikeadeleke / gist:ce98fe803a507bb1ae0d
Last active August 29, 2015 14:01
Devise Confirmable with Omniaauth
The players are Devise, Devise Confirmable, and Omniauth Facebook. The issues is hand is that either when I sign up with email or Facebook, the user is not being confirmed in the database and is essentially locked out of the application.
I have provided a series or screenshots to show the issues and will also show the code.
Home page
https://www.dropbox.com/s/u93zkqdq7l8q5a1/Screenshot%202014-05-16%2015.24.57.png
Signing up with Facebook
https://www.dropbox.com/s/yb7yf1cuzhcnfld/Screenshot%202014-05-16%2015.27.07.png
<div class="row">
<div class="col-md-6">
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body, #map-canvas {
height: 600px;
invite_mailer.rb
class InviteMailer < ActionMailer::Base
default from: "mike@domiapp.co"
def invite_notification(invite, email)
@invite = invite
@property = @invite.property
@url = invite_url(@invite)
mail(to: @invite.email, subject: "You've been added as a roommate!")
end
@mikeadeleke
mikeadeleke / gist:68484c00fa4e1eaa685b
Last active August 29, 2015 14:00
Invite Roommates with Unique Tokens
property.rb
class Property < ActiveRecord::Base
before_create :generate_token
validates :total_bedrooms, presence: true
validates :total_bedrooms, numericality: true
validates :total_bathrooms, presence: true
validates :total_bathrooms, numericality: true
validates :address, presence: true
@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>
@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 / 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: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