Skip to content

Instantly share code, notes, and snippets.

ericstumper / index.html
Created Jan 24, 2020
Fixed header example
View index.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
body {
margin: 0;
View reducer.js
[LOAD_METER_DATA_LATEST_FRAME]: (state, action) => {
const currentPropertyId =
x => === action.payload
return {
data: {,
[currentPropertyId]: {[currentPropertyId],
ericstumper / 0_reuse_code.js
Created Feb 6, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
ericstumper / index.js
Created Jul 3, 2016
Navigation component handling logout
View index.js
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';
ericstumper / state.json
Created Jul 3, 2016
State after one user logging in, logging out directly after and another user logging in afterwards
View state.json
This file has been truncated, but you can view the full file.
"monitorState": {},
"actionsById": {
"0": {
"action": {
"type": "@@INIT"
"timestamp": 1467536860691,
ericstumper / context.ex
Created Jun 10, 2016
Guardian Authentication with Absinthe GraphQL in Elixir
View context.ex
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} ->
ericstumper / schema.ex
Created Jun 9, 2016
JWT Token creation with Absinthe and Guardian
View schema.ex
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
View router.ex
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