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
| <?php | |
| namespace App\Support; | |
| use Str; | |
| class Helper { | |
| /** | |
| * e.g., X4345-ZXCA4-S3XYB-3AST1 | |
| */ |
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
| /** | |
| * Supercharges GatewayDest so that it allows default children, because this does not work: | |
| * <GatewayDest><div>Default content if nobody has passed anything to me yet.</GatewayDest> | |
| * @see https://github.com/cloudflare/react-gateway/pull/39 | |
| * | |
| * @usage <GatewayDestWithFallback name={constants.gateway.backUrl} fallback={<UiNavigation.Action />} /> | |
| */ | |
| import * as React from 'react' | |
| import { GatewayDest } from 'react-gateway' |
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
| import { parse, subDays } from 'date-fns'; | |
| import getEntryTodayDateString from './getEntryTodayDateString' | |
| import getEntryDateString from './getEntryDateString' | |
| /** | |
| * Get the streak between today and the last date. | |
| * Assumes that there is an entry for today. | |
| */ | |
| export default function getStreak(tracker: AppDataTracker): number { |
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
| <?php | |
| namespace App\Support; | |
| class Helper { | |
| /** | |
| * Converts an array of objects into an object, keys based on its key | |
| * [{ "entry_date": "" }, { "entry_date": "" }] -> { "2019-08-20": {}, ... } | |
| */ | |
| static public function toPropertyKeys($array, $property) { |
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 NUMERIC_0 = 48 | |
| const NUMERIC_9 = 57 | |
| /** | |
| * Check if the pressed key (evt.keyCode) is a numeric key | |
| */ | |
| export default function isNumericKeyCode(key: number): boolean { | |
| return key >= NUMERIC_0 && key <= NUMERIC_9 | |
| } |
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
| import * as React from 'react' | |
| import { Route } from 'react-router-dom' | |
| import { RouteProps } from 'react-router' | |
| class RouterRoute extends React.Component<RouteProps> { | |
| render() { | |
| const { component, children, ...rest } = this.props | |
| const Component = this.props.component | |
| return ( |
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
| /** | |
| * Check if an element is under an anchor element | |
| */ | |
| function isDescendantOfAnchor(element) { | |
| do { | |
| if (element.tagName === 'A') { | |
| return true | |
| } | |
| } while(element = element.parentNode) |
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
| <h5 class="text-fade-in js-animatable" data-animatable-offset="256" data-animatable-delay="200">Staging</h5> | |
| <h5 class="text-fade-in js-animatable" data-animatable-offset="324" data-animatable-delay="300">Deep-cleaning</h5> | |
| <h5 class="text-fade-in js-animatable" data-animatable-offset="324" data-animatable-delay="400">Cosmetic renovations</h5> | |
| <h5 class="text-fade-in js-animatable" data-animatable-offset="358" data-animatable-delay="500">Decluttering</h5> | |
| <h5 class="text-fade-in js-animatable" data-animatable-offset="392" data-animatable-delay="600">Landscaping</h5> | |
| <h5 class="text-fade-in js-animatable" data-animatable-offset="460" data-animatable-delay="700">Painting</h5> | |
| <h5 class="text-fade-in js-animatable" data-animatable-offset="460" data-animatable-delay="800">Pest control</h5> | |
| <h5 class="text-fade-in js-animatable" data-animatable-offset="494" data-animatable-delay="900">Custom closets</h5> | |
| <div class="photo-cover js-animatable"> |
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
| import { Location, LocationState } from 'history'; | |
| import { RouteComponentProps as ReactRouteComponentProps } from 'react-router-dom' | |
| export interface RouteComponentProps<Q = { [key: string]: string }> extends ReactRouteComponentProps { | |
| location: Location<LocationState> & { | |
| query: Q | |
| }; | |
| } |
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
| // Error404Context.js | |
| export default {Provider, Consumer} = React.createContext() | |
| // Error404Provider.js | |
| class Error404Provider extends React.Component { | |
| state = { | |
| isError: false | |
| } | |
| render() { |