This file contains hidden or 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
| class ProfileAttributeProvider | |
| def initialize(model) | |
| @model = model | |
| end | |
| def call | |
| ProfileField.all.map do |field| | |
| ActiveDynamic::AttributeDefinition.new(field.name, field.datatype) | |
| end |
This file contains hidden or 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
| FILES_WITHOUT_FLOW="$(grep -r --include=\*.js -L "@flow" src)" | |
| FILES_COUNT=$(echo $FILES_WITHOUT_FLOW | wc -w) | |
| if [ $FILES_COUNT -ne 0 ] | |
| then | |
| echo "Following files are missing @flow annotation:" | |
| echo $FILES_WITHOUT_FLOW | tr " " "\n" | |
| exit 1 | |
| fi |
This file contains hidden or 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
| // @flow | |
| const SIZE = Object.freeze({ | |
| LARGE: "large", | |
| MEDIUM: "medium", | |
| SMALL: "small" | |
| }) | |
| type ISize = $Values<typeof SIZE> |
This file contains hidden or 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
| // @flow | |
| const SIZE = Object.freeze({ | |
| LARGE: "large", | |
| MEDIUM: "medium", | |
| SMALL: "small" | |
| }) | |
| type ISize = $Values<typeof SIZE> | |
This file contains hidden or 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
| // @flow | |
| const isStringEmpty = (str?: string) => { | |
| return str && str.trim() !== "" | |
| } | |
| const first = isStringEmpty(null) | |
| const second = isStringEmpty("") | |
| const third = isStringEmpty("test") |
This file contains hidden or 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
| // @flow | |
| const isStringEmpty = (str?: string): boolean => { | |
| return Boolean(str && str.trim() !== "") | |
| } | |
| const first = isStringEmpty(null) | |
| const second = isStringEmpty("") | |
| const third = isStringEmpty("test") |
This file contains hidden or 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
| // @flow | |
| export type IProps = {| | |
| +title: string, | |
| +description?: string, | |
| |} | |
| class Post extends React.Component<IProps, {}> { | |
| componentDidMount() { |
This file contains hidden or 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
| // @flow | |
| const SIZE = /*::Object.freeze(*/{ | |
| LARGE: "large", | |
| MEDIUM: "medium", | |
| SMALL: "small" | |
| } | |
| }/*::)*/ | |
| type ISize = $Values<typeof SIZE> |
This file contains hidden or 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 AdventOfCode.Day01 do | |
| def solve(part) when part == :one do | |
| nums = parse_input() | |
| init = delta(Enum.at(nums, 0), Enum.at(nums, -1)) | |
| Enum.chunk_every(nums, 2, 1, :discard) | |
| |> Enum.reduce(init, fn([a, b], acc) -> | |
| acc + delta(a, b) | |
| end) | |
| end |
This file contains hidden or 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
| const theme = { | |
| color: { | |
| text: '#141414', | |
| primary: '#023EBE', | |
| danger: '#E90056' | |
| }, | |
| fontSize: { | |
| header: '2rem', | |
| subTitle: '1.8rem', | |
| text: '1.6rem' |
OlderNewer