Skip to content

Instantly share code, notes, and snippets.

View aaronjensen's full-sized avatar

Aaron Jensen aaronjensen

View GitHub Profile
;; Runs eslint --fix after save
(defun eslint-fix ()
(interactive)
(let* ((command (list flycheck-javascript-eslint-executable
"--fix"
buffer-file-name))
(process-connection-type nil)
(process (apply 'start-process "eslint-fix" nil command)))
(set-process-sentinel process #'eslint-fix-handle-signal)))
// @flow
/* eslint-disable */
declare module 'react-router' {
declare type RenderArgs = {
params: Object,
location: Location,
}
declare type RenderFn = (args: RenderArgs) => React$Element<*>
// @flow
/* eslint-disable */
declare module 'redux-form' {
declare export type InputProps = {
checked?: boolean,
name: string,
value: any,
onBlur: Function,
onChange: Function,
@aaronjensen
aaronjensen / Root.js
Created September 23, 2016 01:05
Fake ControlledRouter with external history access
// @flow
import React from 'react'
import { Provider as Redux, connect } from 'react-redux'
import BrowserHistory from 'react-history/BrowserHistory'
import { StaticRouter } from 'react-router'
import { setLocation } from 'app/actions/app'
import { setHistory } from 'lib/history'
import App from 'app/sections/App'
import type { Store } from 'types'
defmodule Executable do
@moduledoc """
Executables are either commands or queries.
They should declare a struct that dictates the shape and defaults of their
parameters and an `execute/1` function that takes that struct and does
something in response.
"""
use Behaviour
const styles = StyleSheet.create({
container: {
...flex,
...itemsCenter,
},
border: {
...border,
...margin.right(2),
width: '20rem',
height: '2rem',
// @flow
/* eslint-disable */
// This interface is not complete. Only properties accepting
// unitless numbers are listed here (see CSSProperty.js in React)
type CSSProperties = {
alignContent?: any;
alignItems?: any;
alignSelf?: any;
alignmentAdjust?: any;
defmodule App.Api.HotelController do
use App.Executable.Controller, action: :show
alias App.Queries.GetHotelDetails
alias App.Plug.CacheControl
alias App.Plug.EnforceRequiredParams
alias App.Plug.SetProviderModule
import App.Parse, only: [float!: 1]
plug SetProviderModule
plug EnforceRequiredParams, enforce: ["hotel_id", "event_latitude", "event_longitude"]
client/app/components/buttons/Button.js:18
18: <button type={type} onClick={onClick} className={css(styles.button)}>
^^^^^^^^^^^^^^^^^^ function call
18: <button type={type} onClick={onClick} className={css(styles.button)}>
^^^^^^^^^^^^^ object literal. This type is incompatible with
1448: declare function css(...styles: Style[]): string;
^^^^^ union: StyleDeclaration | boolean literal `false`. See lib: flow-typed/unofficial/aphrodite.js:1448
Member 1:
1442: declare type Style = $Subtype<StyleDeclaration> | false
^^^^^^^^^^^^^^^^ StyleDeclaration. See lib: flow-typed/unofficial/aphrodite.js:1442
// @flow
import React from 'react'
import { StyleSheet, css } from 'aphrodite'
import { border } from 'app/style'
export type InputType =
'text' |
'email' |
'password'