Skip to content

Instantly share code, notes, and snippets.

View thebrianemory's full-sized avatar

Brian Emory thebrianemory

View GitHub Profile
config :your_app, YourAppWeb.Endpoint,
load_from_system_env: true,
url: [scheme: "https", host: "your_app.herokuapp.com", port: 443],
force_ssl: [rewrite_on: [:x_forwarded_proto]],
cache_static_manifest: "priv/static/cache_manifest.json",
secret_key_base: Map.fetch!(System.get_env(), "SECRET_KEY_BASE")
heroku config:set GOOGLE_CLIENT_ID=your_google_id
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Code removed for readbility -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="<%= static_path(@conn, "/css/tilex.css") %>"> <!-- Change it here -->
exports.config = {
files: {
javascripts: {
joinTo: "js/tilex.js" // Change it here
},
stylesheets: {
joinTo: 'css/tilex.css', // Change it here
order: {
after: ["web/static/css/tilex.css"] // Change it here
}
erlang_version=20.1
elixir_version=1.5.2
runtime_path=/app
phoenix_relative_path=apps/your_app
defp authenticate(%{info: info, uid: uid}) do
email = Map.get(info, :email)
name = Developer.format_username(Map.get(info, :name))
case String.match?(email, ~r/@your_domain.com$/) do # Change your_domain to your domain
true ->
attrs = %{
email: email,
username: name,
google_id: uid
# config/dev.exs
config :tilex, :default_twitter_handle, "your_twitter_handle"
# config/test.exs
config :tilex, Tilex.Repo,
adapter: Ecto.Adapters.Postgres,
username: "your_username", # depending on your Postgres setup, most likely your home directory name
defmodule YourAppWeb.Endpoint do
# Code removed for readability
plug Plug.Static,
at: "/", from: :tilex, gzip: false, # Change this line from :your_app to :tilex as shown
only: ~w(css fonts images js favicon.ico robots.txt)
# Code removed for readability
end
http://localhost:4004/auth/google/callback
https://til.yourdomain.com/auth/google/callback