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 const listCountries = () => { | |
return [ | |
{ | |
name: 'Afghanistan', | |
code: 'AF', | |
capital: 'Kabul', | |
region: 'AS', | |
currency: { | |
code: 'AFN', | |
name: 'Afghan afghani', |
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
Add this middleware on the route you are using for your fortify web/api before the throttle and bindings | |
\Illuminate\Session\Middleware\StartSession::class, | |
\Illuminate\View\Middleware\ShareErrorsFromSession::class, |
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
if($this->app->environment('production')) | |
{ | |
\URL::forceScheme('https'); | |
} |
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, { useEffect, useReducer } from 'react'; | |
import axios from 'axios' | |
import './App.css'; | |
const initialState = { | |
loading: true, | |
error: "", | |
todos: [], | |
}; | |
const reducer = (state, action) => { |
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
//Using action.payload to have a flexible data | |
import React, { useReducer } from 'react' | |
import { Button, ButtonGroup, Badge } from 'reactstrap'; | |
import 'bootstrap/dist/css/bootstrap.min.css'; | |
const initialState = { | |
counter1: 0, | |
counter2: 10 | |
} | |
const reducer = (state, action) => { |
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 from 'react' | |
import ComponentB from './ComponentB' | |
const ComponentA = () => { | |
return ( | |
<div> | |
<div>ComponentA</div> | |
<ComponentB /> | |
</div> | |
) | |
} |
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
{items.map(item => (NEVER FORGET THE DIFF BETWEEN BRACKET AND PARENTHESIS))} |
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
rm -rf node_modules | |
rm package-lock.json yarn.lock | |
npm cache clear --force | |
npm install | |
npm run dev |
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 [formData, setFormData] = useState({ | |
name: "", | |
email: "", | |
etc: "" | |
}); | |
const onSubmitHandler = (event) => { | |
e.preventDefault; | |
setFormData({...formData, [event.target.name]: event.target.value}) | |
}; |
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
{ | |
"bring back the scaffold to vue files": { | |
"prefix": "scaffold", | |
"body": [ | |
"<template>", | |
" <div>$TM_FILENAME_BASE</div>", | |
"</template>", | |
"", | |
"<script>", | |
"export default {", |
NewerOlder