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
| name: Build | |
| on: [push] | |
| jobs: | |
| build-js: | |
| name: Build JS | |
| runs-on: ubuntu-18.04 | |
| container: 'ohseemedia/laravel-ci:7.3' | |
| steps: | |
| - uses: actions/checkout@v1 |
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
| { | |
| "Version": "2008-10-17", | |
| "Id": "PolicyForCloudFrontPrivateContent", | |
| "Statement": [ | |
| { | |
| "Sid": "1", | |
| "Effect": "Allow", | |
| "Principal": { | |
| "AWS": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity XXXXXXX" | |
| }, |
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
| function App() { | |
| if (props.loading) { | |
| return; // Bad! Should return `null` here instead | |
| } | |
| return null; // Fixed! | |
| } |
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
| [dev] | |
| publish = "out" | |
| port = 3000 | |
| command = "npm start" |
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 name = "Owen"; | |
| console.log(`Hello world!`); |
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 | |
| class EventServiceProvider extends ServiceProvider | |
| { | |
| /** | |
| * The event listener mappings for the application. | |
| * | |
| * @var array | |
| */ | |
| protected $listen = [ |
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
| function MyComponent(props) { | |
| if (props.id) { | |
| // BAD! Hooks cannot be used inside a conditional statement | |
| useEffect(() => { | |
| axios.get(`/api/data?id=${props.id}`); | |
| }); | |
| } | |
| // ...render the component | |
| } |
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 App extends React.Component { | |
| componentDidMount() { | |
| // BAD! | |
| const [state, setState] = React.useState(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
| <?php | |
| namespace App\Http\Middleware; | |
| use Closure; | |
| use Illuminate\Support\Facades\Log; | |
| class RequestLogger | |
| { | |
| /** @var int */ |
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 | |
| ProcessPodcast::dispatch($podcast); |