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 name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>Document</title> | |
<style> | |
body { | |
margin: 0; |
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
[LOAD_METER_DATA_LATEST_FRAME]: (state, action) => { | |
const currentPropertyId = state.data.findIndex( | |
x => x.id === action.payload | |
); | |
return { | |
...state, | |
data: { | |
...state.data, | |
[currentPropertyId]: { | |
...state.data[currentPropertyId], |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
import React, { Component } from 'react'; | |
import { bindActionCreators } from 'redux'; | |
import { connect } from 'react-apollo'; | |
import { push } from 'react-router-redux'; | |
import { Link, IndexLink } from 'react-router'; | |
import * as authActionCreators from 'actions/auth'; | |
import { deleteToken } from 'mutations/auth'; | |
import styles from './styles.css'; |
This file has been truncated, but you can view the full file.
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
{ | |
"monitorState": {}, | |
"actionsById": { | |
"0": { | |
"type": "PERFORM_ACTION", | |
"action": { | |
"type": "@@INIT" | |
}, | |
"timestamp": 1467536860691, | |
"duration": 0.4049999999999727 |
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 Languafy.Web.Context do | |
@behaviour Plug | |
import Plug.Conn | |
alias Languafy.User | |
def init(opts), do: opts | |
def call(conn, _) do | |
case build_context(conn) do | |
{:ok, context} -> |
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 Languafy.Schema do | |
use Absinthe.Schema | |
import_types Languafy.Schema.Types | |
query do | |
@desc "Get an App User" | |
field :user, type: :user do | |
arg :id, non_null(:id) | |
resolve &Languafy.Resolver.User.find/2 | |
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 Languafy.Router do | |
use Languafy.Web, :router | |
pipeline :browser do | |
plug :accepts, ["html"] | |
plug :fetch_session | |
plug :fetch_flash | |
plug :protect_from_forgery | |
plug :put_secure_browser_headers | |
end |