Skip to content

Instantly share code, notes, and snippets.

View bootcoder's full-sized avatar

Hunter Chapman bootcoder

View GitHub Profile
@bootcoder
bootcoder / ReduxRootComponent.jsx
Last active November 5, 2018 19:16
ReduxRootComponent Architecture
// ReduxRootComponent.tsx
import React from 'react'
import { Provider } from 'react-redux'
import WebpackerReact from 'webpacker-react'
import configureStore from '../store/configureStore'
const store = configureStore()
@bootcoder
bootcoder / some_controller.rb
Created November 11, 2019 18:47
DRY up named arguments
# frozen_string_literal: true
class Api::V2::Users::UsersController < Api::V2::BaseController
soft_authentication :current
def current
user_json = ActiveModelSerializers::SerializableResource.new(current_user,{show_subscriptions: true}).as_json
raise AuthorizationError unless current_user
render json: user_json, status: :ok, show_subscriptions: true