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(process.argv.length < 3){ | |
| console.log('target file path is required.') | |
| process.exit(1) | |
| } | |
| var target = process.argv[2] | |
| console.log('file: ' + target) | |
| var fs = require('fs') | |
| fs.readFile(target, function (err, data) { |
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
| module.exports = function(sequelize, Sequelize) { | |
| var User = sequelize.define('user', { | |
| id: { autoIncrement: true, primaryKey: true, type: Sequelize.INTEGER}, | |
| firstname: { type: Sequelize.STRING,notEmpty: true}, | |
| lastname: { type: Sequelize.STRING,notEmpty: true}, | |
| username: {type:Sequelize.TEXT}, | |
| about : {type:Sequelize.TEXT}, | |
| email: { type:Sequelize.STRING, validate: {isEmail:true} }, | |
| password : {type: Sequelize.STRING,allowNull: false }, |
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
| randomArray = Array.from({length: 10}, () => Math.floor(Math.random() * 40)); | |
| console.log("Random: ",randomArray); | |
| var even = [];var odd = []; | |
| processArray(randomArray) | |
| async function processArray(data) { | |
| for(const item of data){ | |
| // console.log(item) | |
| await asyncCall(item) |
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 ReactDOM from 'react-dom'; | |
| import axios from 'axios'; | |
| class FetchDemo extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| posts: [] |
NewerOlder