Skip to content

Instantly share code, notes, and snippets.

View richessler's full-sized avatar

Richard Hessler richessler

View GitHub Profile
// EmailAttachment
"---------- Forwarded message ----------\r\nFrom: Doug Hathaway <doug@dadesystems.com>\r\nDate: Tue, Jun 7, 2016 at 9:13 AM\r\nSubject: Fwd: FW: Hajoca Corporation Payment Voucher\r\nTo: Richard Hessler <richard.hessler@dadesystems.com>\r\n\r\n\r\nCan you show me what the TXT file would look like for this email (via our\r\nmailgun stuff)\r\n\r\n---------- Forwarded message ----------\r\nFrom: Financial Services - BemisPay <Financial.Services@bemismfg.com>\r\nDate: Wed, Jun 1, 2016 at 9:19 AM\r\nSubject: FW: Hajoca Corporation Payment Voucher\r\nTo: \"bemis-test@dadepay.com\" <bemis-test@dadepay.com>, \"bemis@dadepay.com\" <\r\nbemis@dadepay.com>\r\nCc: \"doug@dadesystems.com\" <doug@dadesystems.com>\r\n\r\n\r\n\r\n\r\n\r\n\r\n*From:* Hajoca Corporation [mailto:ap@hajoca.com]\r\n*Sent:* Tuesday, May 31, 2016 11:06 AM\r\n*To:* Financial Services - BemisPay\r\n*Subject:* Hajoca Corporation Payment Voucher\r\n\r\n\r\n\r\n*HAJOCA CORPORATION*\r\n127 Coulter Avenue - Ardmore, PA 19003\r\n\r\n\
<HTML>
<head>
<title>Merchant1 checkout</title>
<style>
body {
font-size:10pt;
}
.checkout {
background-color:lightgreen;
width: 50%;
# Create an application
# This is all done in rails console while in the project folder
app = Doorkeeper::Application.create :name => 'test', :redirect_uri => 'https://richard-district-api.herokuapp.com/'
# => #<Doorkeeper::Application id: 5, name: "test", uid: "19cba7b2992094e27d3c24015986bb86c1dafeb3fc1a1529c1...", secret: "999e925987a7e7e48b6511752558e103fb3b96349d23cc7b0c...", redirect_uri: "https://richard-district-api.herokuapp.com/", scopes: "", created_at: "2016-05-28 01:18:18", updated_at: "2016-05-28 01:18:18">
# NOTE: The redirect is an example, but really just needs to be a valid url for this to work, if doing on heroku, it has to be HTTPS, local can be http.
# Get Client ID and Client Secret

INBOUND MAIL RAILS CONSUMING TOOL REVIEW

GRIDDLER

What is it?

Griddler is a Rails engine that provides an endpoint for SendGrid, Cloudmailin, Postmark or Mandrill and hands off the email to your application.

Comes with baked-in adapters to solve the problem at hand

  • Maintained by Thoughtbot
  • Great Documentation
# frozen_string_literal: true
module API
module V1
module Resources
module Messaging
class Conversations < API::V1::Root
resources :conversations, decs: 'Operations related to Conversations' do
desc 'Get existing Conversations for a User' do
headers API::V1::Defaults.auth_headers
success API::V1::Entities::Messaging::Conversation
# frozen_string_literal: true
module API
module V1
module Entities
module Messaging
class Conversation < Grape::Entity
format_with(:iso_timestamp, &:iso8601)
expose :id, documentation: { type: Integer, desc: 'The unique Conversation Identifier.' }
expose :users, as: :user_previews, using: API::V1::Entities::Messaging::Preview
@richessler
richessler / index.ios.js
Created April 21, 2016 19:21
Example logic behind our detailed post view.
'use strict';
var React = require('react-native');
var {
StyleSheet,
Image,
Text,
NavigatorIOS,
View,
@richessler
richessler / user.rb
Last active December 30, 2015 06:08
class User < ActiveRecord::Base
validates :email, :type, presence: true, length: { maxiumum: 60 }
validates :email, uniqueness: true
end
class UsersController < ApplicationController #for formalities, you know...
#for user login we would typically use a sessions controller, but for the sake of the assignment we'll call that `#new_user_session` within this controller
def new
@user = User.new
end
#user registration with no auth
def create

I have been toying with the idea, since I knew we were doing 3 projects, to do something wine related for my first project. I reached out to my facebook friends and asked them to submit a few user stories as expectations. So far I have some good feedback (mostly), with a few expectations that are far beyond my reach, at the moment:

    As an amateur with wine, I want to know what foods pair well with wine so I can enjoy the food and drink experience at          it's max potential. 

    As a casual drinker, I would want to find the place that sells my favorite wine at the lowest price so that I can spend         as little as possible.

    As a person who wants to find a new wine to try, I want a way to compare wines by price, flavor, and area of origin so          that I can filter wines that I'm more likely to enjoy.

As a forgetful person I want to be able to open the app and it tell me what I have liked in the past and give me new recommendations based on that. Also I'd