Skip to content

Instantly share code, notes, and snippets.

{
"development": {
"username": "root",
"password": "password",
"database": "database_development",
"host": "127.0.0.1",
"dialect": "mysql",
"operatorsAliases": false
},
"test": {
@aabccd021
aabccd021 / config.json
Created April 27, 2020 23:04
Default sequelize config
{
"development": {
"username": "root",
"password": null,
"database": "database_development",
"host": "127.0.0.1",
"dialect": "mysql",
"operatorsAliases": false
},
"test": {
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
/*
Add altering commands here.
Return a promise to correctly handle asynchronicity.
Example:
return queryInterface.createTable('users', { id: Sequelize.INTEGER });
*/
},
module.exports = {
// eslint-disable-next-line no-unused-vars
up: (queryInterface, Sequelize) => {
return queryInterface.removeColumn('users', 'username');
},
down: (queryInterface, Sequelize) => {
return queryInterface.addColumn('users', 'username', {
allowNull: true,
type: Sequelize.STRING
import * as React from 'react';
const { useState } = React;
export const UseStateSample = () => {
const [count, setCount] = useState(0);
return (
<p>
<button onClick={() => setCount(count - 1)}>-</button>
<b>{count}</b>
import * as React from 'react';
const { useState } = React;
export const UseStateSample = () => {
const [count, setCount] = useState(0);
return (
<p>
<button onClick={() => setCount(count - 1)}>-</button>
<b>{count}</b>
export class ContohUseState extends React.Component {
state = { count: 0 };
render() {
const { count } = this.state;
return (
<p>
<button onClick={() => this.setState({ count: count - 1 })}>-</button>
<b>{count}</b>
<button onClick={() => this.setState({ count: count + 1 })}>+</button>
</p>
import * as React from 'react';
const { useState } = React;
export const ContohUseState = () => {
const [count, setCount] = useState(0);
return (
<p>
<button onClick={() => setCount(count - 1)}>-</button>
<b>{count}</b>
<button onClick={() => setCount(count + 1)}>+</button>
const initialState = {
password: '',
confirmPassword: ''
};
const ResetPasswordPage = () => {
const [form, setForm] = useState(initialState);
const [errorMessage, setErrorMessage] = useState(initialState);
const onFormChange = (fieldName, value) => {