This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
response = ChargifyV2.get!("/calls/" <> call_id) | |
errors = response.body[:call]["response"]["result"]["errors"] | |
IO.inspect errors | |
[%{"attribute" => "customer.first_name", | |
"message" => "First name: cannot be blank."}, | |
%{"attribute" => "customer.last_name", | |
"message" => "Last name: cannot be blank."}, | |
%{"attribute" => "customer.email", | |
"message" => "Email address: cannot be blank."}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mix phoenix.new test_project | |
[...] | |
* creating test_project/web/static/assets/robots.txt | |
* creating test_project/web/static/assets/images/phoenix.png | |
* creating test_project/web/static/assets/favicon.ico | |
Fetch and install dependencies? [Yn] Y | |
* running npm install && node node_modules/brunch/bin/brunch build | |
* running mix deps.get |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[info] Running MyApp_802337.Endpoint with Cowboy on http://localhost:4000 | |
02 Aug 20:58:34 - info: compiled 3 files into 2 files, copied 3 in 8060ms | |
[info] GET /api/tasks/1.json | |
[debug] Processing by MyApp_802337.TaskController.show/2 | |
Parameters: %{"format" => "json", "id" => "1.json"} | |
Pipelines: [:api] | |
[info] Sent 400 in 456ms | |
[error] #PID<0.294.0> running MyApp_802337.Endpoint terminated | |
Server: localhost:4000 (http) | |
Request: GET /api/tasks/1.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21:05:35.526 request_id=7OAOqWxZPN0KhWAW/0p7 [info] %OAuth2.AccessToken{access_token: nil, client: %OAuth2.Client{authorize_url: "https://www.fitbit.com/oauth2/authorize", client_id: "22ABCD", client_secret: "c08ac2a9XXXXXXXa55caffb21292", headers: [{"Content-Type", "application/x-www-form-urlencoded"}, {"Accept", "application/json"}], params: %{"client_id" => "229MBF", "client_secret" => "c08ac2aXXXXXXXXXa55caffb21292", "code" => "e590a00XXXXXXXXXX1bb1d43d2906b515408", "grant_type" => "authorization_code", "redirect_uri" => "http://lvh.me:4000/auth/callback"}, redirect_uri: "http://lvh.me:4000/auth/callback", site: "https://api.fitbit.com", strategy: Fitbit, token_method: :post, token_url: "https://api.fitbit.com/oauth2/token"}, expires_at: nil, other_params: %{"errors" => [%{"errorType" => "oauth", "fieldName" => "n/a", "message" => "No Authorization header provided in the request. Each call to Fitbit API should be OAuth signed"}], "success" => false}, refresh_token: nil, token_type: "Bearer"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In this bit of http://elixir-lang.org/getting-started/case-cond-and-if.html | |
Clauses also allow extra conditions to be specified via guards: | |
iex> case {1, 2, 3} do | |
...> {1, x, 3} when x > 0 -> | |
...> "Will match" | |
...> _ -> | |
...> "Won't match" | |
...> end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git push heroku master | |
Counting objects: 57, done. | |
Delta compression using up to 8 threads. | |
Compressing objects: 100% (51/51), done. | |
Writing objects: 100% (57/57), 48.86 KiB | 0 bytes/s, done. | |
Total 57 (delta 1), reused 0 (delta 0) | |
remote: Compressing source files... done. | |
remote: Building source: | |
remote: | |
remote: -----> Fetching custom git buildpack... done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Following http://www.phoenixframework.org/v0.14.0/docs/installation | |
I've run into this: | |
$ mix local.hex | |
** (Mix) Could not access url https://s3.amazonaws.com/s3.hex.pm/installs/list.csv, error: {:failed_connect, [{:to_address, {'s3.amazonaws.com', 443}}, {:inet, [:inet], :eperm}]} | |
$ curl https://s3.amazonaws.com/s3.hex.pm/installs/list.csv | |
0.0.1,0.13.0-dev | |
0.1.0,0.13.1-dev | |
0.1.1,0.13.1-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { | |
var component1 = $("#component_allocated_quantity_XXXXX"); | |
component1.val(1); | |
$("#subscription_submit").click(function(){ | |
if ( component1.val() <= 0 ) { | |
component1.addClass("field-error"); | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.field-error { | |
color: #b94a48 !important; | |
background: #f2dede !important; | |
border: solid 1px #eed3d7 !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function removeCouponSuccessMessage() { | |
coupon_text = $('#long_coupon_message').find(".success_message"); | |
coupon_text.text(""); | |
}; | |
$(document).bind("afterSummaryRefresh", removeCouponSuccessMessage); |