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
| // parse-ms | |
| // MIT License, copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) | |
| // Modified by Dobby233Liu in slight cooperation with MIT License | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), | |
| // to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
| // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
| // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
| // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | |
| // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |
| // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
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="en"> | |
| <head> | |
| <title>My page</title> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width" /> | |
| <script src="https://cdn.jsdelivr.net/combine/npm/react@16.12/umd/react.development.js,npm/react-dom@16.12/umd/react-dom.development.js,npm/@material-ui/core@4.8/umd/material-ui.development.js,npm/@babel/standalone@7.8/babel.min.js" crossorigin="anonymous"></script> | |
| <!-- Seperate Links | |
| src: https://github.com/mui-org/material-ui/blob/master/examples/cdn/index.html --> |
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 { Component, h } from 'preact'; | |
| import ListItem from '../list-item'; | |
| export default class List extends Component<{}, { indices: number[] }> { | |
| state = { indices: [0, 1, 2, 3] }; | |
| public render() { | |
| 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
| export class Deferred extends Promise { | |
| constructor(executor) { | |
| super( (resolve, reject) => { | |
| this.resolve = resolve; | |
| this.reject = reject; | |
| if (executor) executor(resolve, reject); | |
| }); | |
| } | |
| } |
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
| /** | |
| * Our component structure will look like the following: | |
| * - WikiBox | |
| * -- AutoCompleteBox | |
| * --- AutoComplete | |
| */ | |
| /** Renders a single entity coming from wikipedia */ | |
| class AutoComplete extends React.Component { | |
| render() { |
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
| /** Slay and pillage an unprotected network! ...oh, we can't do that? | |
| * Ok, let's publish an event instead, to a backdrop of flashing lights | |
| * and clashing of metal on metal. | |
| */ | |
| void vanquishOpenNetwork() { | |
| if (!openNetworkCount || !strongest.rssi) { | |
| return; | |
| } | |
| // allow the system to control the LED so we can see cloud connection progress |
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
| // Node style module writ in ES6 syntax: | |
| export default foo = () => console.log(‘hi’) | |
| // Unfortunately “literally” transpiles to this: | |
| exports.default = function foo() { | |
| return console.log(‘hi’) | |
| } | |
| // Which means this will fail: | |
| var foo = require(‘./foo’) |