View redux-test.js
import {expect} from 'chai';
import reducer from '../index'
describe('image_uploader reducer', () => {
describe('init', () => {
it('should initialize state', () => {
const action = {}
const result = {
View actions.js
mport {createAction} from 'redux-actions'
import {METHOD_GET, METHOD_POST, METHOD_PUT, createApiMeta} from '../../../common/js/actions/helpers/api';
export const aaaGet = createAction('AAA_GET',
() => ( null ),
(id) => createApiMeta(`/api/company_branches/${id}`, null, METHOD_GET));
View rails g
# model
rails g model Company --no-migration -t rspec
# controller (page)
rails g controller Rules -t rspec
# scaffold
rails generate scaffold Plan -t rspec
View elixir_google_place.ex
defmodule GooglePlaces do
@moduledoc false
# https://developers.google.com/places/web-service/?hl=ja
use HTTPoison.Base
#require Logger
@text_search "/textsearch/json?key=<api key>"
View phoenix auth model
mix phoenix.gen.json UserAuth user_auths email:string encrypted_password:string password:string type:string
View ecto_gen_migration.ex
mix ecto.gen.migration add_posts_table
View js_log.js
console.debug("%O", obj)
View make_fake.exs
SampleElixirEctoSelect.Repo.start_link
alias SampleElixirEctoSelect.RssFeed
Enum.map 0..99,
fn _ ->
params = %{
feed_url: Faker.Internet.url,
title: Faker.Commerce.product_name,
subtitle: Faker.Company.bs,
View elixir_logger.ex
require Logger
Logger.info "path: " <> inspect(conn.params["paths"])