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
exports.config = { | |
// See http://brunch.io/#documentation for docs. | |
files: { | |
javascripts: { | |
joinTo: "js/app.js" | |
// To use a separate vendor.js bundle, specify two files path | |
// http://brunch.io/docs/config#-files- | |
// joinTo: { | |
// "js/app.js": /^js/, |
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
def handle_info(:after_join, socket) do | |
user = Repo.get(User, socket.assigns.user_id) | |
{:ok, _} = Presence.track(socket, user.email, %{ | |
online_at: inspect(System.system_time(:seconds)) | |
}) | |
push socket, "presence_state", Presence.list(socket) | |
{:noreply, socket} | |
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
# http://imgur.com/a/Bp59w <- Images are stacked on top of each other in the first image. | |
# Images are properly positioned in the last image. | |
# Template | |
<div class="portfolio-wrapper" > | |
<div class="col-md-12"> | |
<h3 class="text-center">Sjekk ut noen av nettsidene vi tidligere har levert</h3> | |
</div> |
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
%{"34425" => %{"extract" => "Z (named zed /ˈzɛd/' or zee /ˈziː/) is the 26th and final letter of the modern English alphabet and the ISO basic Latin alphabet.\n\n", | |
"ns" => 0, "pageid" => 34425, "title" => "Z"}} |
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
%{"batchcomplete" => "", | |
"query" => %{"normalized" => [%{"from" => "test", "to" => "Test"}], | |
"pages" => %{"11089416" => %{"extract" => "Test, TEST or Tester may refer to:\nTest (assessment), an assessment intended to measure the respondents' knowledge or other abilities\nMedical test, to detect, diagnose, or monitor diseases", | |
"ns" => 0, "pageid" => 11089416, "title" => "Test"}}}} |
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
Prefix Verb URI Pattern Controller#Action | |
new_user_session GET /users/sign_in(.:format) devise/sessions#new | |
user_session POST /users/sign_in(.:format) devise/sessions#create | |
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy | |
user_password POST /users/password(.:format) devise/passwords#create | |
new_user_password GET /users/password/new(.:format) devise/passwords#new | |
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit | |
PATCH /users/password(.:format) devise/passwords#update | |
PUT /users/password(.:format) devise/passwords#update | |
cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<title>Hello Cvapp!</title> |
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
defmodule Cvapp.Auth do | |
import Comeonin.Bcrypt, only: [checkpw: 2, dummy_checkpw: 0] | |
import Plug.Conn | |
def login(conn, user) do | |
conn | |
|> assign(:current_user, user) | |
|> Guardian.Plug.sign_in(user) | |
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
defmodule NaturalNums do | |
def print(1), do: IO.puts(1) | |
def print(n) do | |
print(n - 1) | |
IO.puts(n) | |
end | |
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
def index(conn, _params) do | |
case authenticate(conn) do | |
%Plug.Conn{halted: true} = conn -> | |
conn | |
conn -> | |
users = Repo.all(User) | |
render conn, "index.html", users: users | |
end | |
end |
NewerOlder