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
<base-layout> | |
<template slot="header"> | |
<h1>Here might be a page title</h1> | |
</template> | |
<p>A paragraph for the main content.</p> | |
<p>And another one.</p> | |
<template slot="footer"> | |
<p>Here's some contact info</p> |
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
<div class="container"> | |
<header> | |
<slot name="header"></slot> | |
</header> | |
<main> | |
<slot></slot> | |
</main> | |
<footer> | |
<slot name="footer"></slot> | |
</footer> |
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
<MyPopover open={this.state.open} | |
onOpen={this.handleOpen} | |
onClose={this.handleClose} | |
renderButton={<button>Click!</button>}> | |
<h1>My Popover!!</h1> | |
</MyPopover> |
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
/** | |
* Converts an array-like object into an array. | |
* Array.from doesn't work if an object doesn't have a "length" property. | |
* e.g., Array.from({ 0: 1 }) doesn't work; Array.from({ 0: 1, length: 1 }) does. | |
*/ | |
function arrayFrom (obj: {}): Array<*> { | |
return Object.keys(obj).reduce((set: Array, key: string) => { | |
return [...set, obj[key]] | |
}, []) | |
} |
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
export default function delay(ms) { | |
return new Promise(resolve => { | |
setTimeout(resolve, ms) | |
}) | |
} |
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
<!DOCTYPE html> | |
<html lang="{{ app()->getLocale() }}"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- CSRF Token --> | |
<meta name="csrf-token" content="{{ csrf_token() }}"> |
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
txt |
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 Jimp = require('jimp') | |
const path = require('path') | |
const glob = require('./utils/glob') | |
const optim = 300 | |
async function main() { | |
const files = await glob(path.resolve(__dirname, 'imgsrc/*')) | |
files.forEach(async file => { |
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 React, {Children, cloneElement} from 'react' | |
import T from 'prop-types' | |
/** | |
* Delay component from mounting until promise is resolved. | |
*/ | |
class Resolver extends React.Component { | |
state = { | |
resolved: false, | |
data: null |
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 React, {cloneElement} from 'react' | |
/** | |
* Make it easier to apply HOC to a component | |
* without having to assign it to a variable | |
*/ | |
class Compose extends React.Component { | |
applied = this.props.hoc(this.props.component) | |
render() { |