Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Orion Engleton rsgrafx

🏠
Working from home
View GitHub Profile
@rsgrafx
rsgrafx / paperclip.ex
Last active Sep 18, 2017
Setting up Arc in a phoenix app that was ported from a rails app using paperclip.
View paperclip.ex
# Ecto - Model
defmodule YourPhoenixApp.PaperclipAvatar do
use YourPhoenixApp.Web, :model
alias YourPhoenixApp.{Repo, PaperclipAvatar}
#
# There are places in my existing app where only the avatar image is required.
# So I created a module that sole purpose was to read that data.
#
schema "users" do
field :avatar_file_name, :string
View urbanspoon_reservations.rb
require 'rubygems'
require 'mechanize'
FIRST_NAME = 'FIRST_NAME'
LAST_NAME = 'LAST_NAME'
PHONE = 'PHONE'
EMAIL = 'EMAIL@provider.com'
PARTY_SIZE = 2
SCHEDULE_RANGE = { :start_time => '19:00', :end_time => '20:30' }