Skip to content

Instantly share code, notes, and snippets.

View imetallica's full-sized avatar

Iuri L. Machado imetallica

View GitHub Profile
module MetroUi.Widgets.Accordion exposing ( Model
, defaultAccordion
, update
, view )
import Html
import Html.App
import Html.Attributes as Attr
import MetroUi.Widgets.Frame as Frame
module MetroUi.Css exposing (class, classes, Styles(..))
import List
import MetroUi.Css.SimpleGrid as SimpleGrid
import Html.Attributes as Attr
import Debug
type Styles a = SimpleGrid.Classes a | Others a
open System
type Car = {size: int; name: string}
type Cars = Car list
let bigCar cars =
let zeroCar = {Car.name = ""; Car.size = 0}
List.fold (fun car acc ->
if car.size > acc.size then car
elif car.size < acc.size then acc
config :tasksrc, Tasksrc.Endpoint,
http: [port: {:system, "PORT"}],
url: [scheme: "https", host: "tasksrc-dev.herokuapp.com", port: 443],
force_ssl: [rewrite_on: [:x_forwarded_proto]],
cache_static_manifest: "priv/static/manifest.json",
secret_key_base: System.get_env("SECRET_KEY_BASE")
defp set_tokens(conn, user_from_db) do
case user_from_db.account_level do
99 -> # Admin level
Guardian.Plug.sign_in(conn, user_from_db, perms: %{admin: [:all]})
redirect(conn, to: page_path(conn, :index))
_ -> # Not yet implemented
redirect(conn, to: page_path(conn, :index))
end
end
defmodule PayPal.Transaction do
@moduledoc """
A Transaction structure. All *fields* are required:
- description: String. (Give a description to the transaction.)
- *ammount*:
- *currency*: String. (A 3-letter currency code. All supported
currencies are listed below.)
- *total*: String. (Total to be charged. 10 characters max with
support for 2 decimal places.)
- details:
defmodule Merchant.Gateways.PayPal do
@moduledoc """
The PayPal api. It connects with the PayPal's REST API.
"""
use HTTPoison.Base
use Merchant.Gateway
alias Merchant.Gateways.PayPal
@sandbox_api "https://api.sandbox.paypal.com/"
@live_api "https://api.paypal.com/"
iex(1)> [97,98,99]
'abc'
1> [97,98,99].
"abc"
imetallica@S451LA:~/Projects/squadmarket$ mix phoenix.server
web/channels/auth_channel.ex:55: warning: function authorized?/1 is unused
web/channels/auth_channel.ex:4: warning: variable payload is unused
Compiled web/channels/auth_channel.ex
Generated squadmarket app
[info] Running Squadmarket.Endpoint with Cowboy on http://localhost:4000
22 Dec 21:22:14 - info: compiled 14 files into 2 files, copied 21 in 1750ms
Setting up watches. Beware: since -r was given, this may take a while!
[info] JOIN auth:auth to Squadmarket.AuthChannel
Transport: Phoenix.Transports.WebSocket