Cole no terminal o seguinte comando para instalar a interface de linha de comando do Adonis:
npm install -g @adonisjs/cli
import pandas as pd | |
import re | |
import json | |
import openpyxl | |
import os | |
import codecs | |
df = pd.read_excel('./translations.xlsx', sheet_name = 0) | |
titles = [] |
const initialState = { | |
type: null, | |
payload: null, | |
meta: null, | |
error: false | |
}; | |
export default (state = initialState, action) => { | |
return { | |
...state, |
import { useRef, useState, useEffect } from 'react'; | |
// Usage | |
function App() { | |
const [hoverRef, isHovered] = useHover(); | |
return ( | |
<div ref={hoverRef}> | |
{isHovered ? '😁' : '☹️'} | |
</div> |
import React, { Component } from 'react'; | |
import { BrowserRouter as Router, Route, Link } from "react-router-dom"; | |
import { Layout, Menu, Icon } from 'antd'; | |
import Dashboard from './containers/Dashboard/Dashboard'; | |
import Meseros from './containers/Meseros/Meseros'; | |
const { Header, Content, Footer, Sider } = Layout; | |
const SubMenu = Menu.SubMenu; |
# To host on root path just use "<Location />" for http://mydomainname.in | |
# To host on non-root path use "<Location /myreactapp>" for http://mydomainname.in/mypath | |
# If non-root path, don't forgot to add "homepage": "/myreactapp" in your app's package.json | |
<VirtualHost *:80> | |
ServerName mydomainname.in | |
DirectoryIndex index.html | |
DocumentRoot /var/www/html | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined |
When querying your database in Sequelize, you'll often want data associated with a particular model which isn't in the model's table directly. This data is usually typically associated through join tables (e.g. a 'hasMany' or 'belongsToMany' association), or a foreign key (e.g. a 'hasOne' or 'belongsTo' association).
When you query, you'll receive just the rows you've looked for. With eager loading, you'll also get any associated data. For some reason, I can never remember the proper way to do eager loading when writing my Sequelize queries. I've seen others struggle with the same thing.
Eager loading is confusing because the 'include' that is uses has unfamiliar fields is set in an array rather than just an object.
So let's go through the one query that's worth memorizing to handle your eager loading.
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
const axios = require('axios'); // promised based requests - like fetch() | |
function getCoffee() { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
}); | |
} |
/* | |
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects. | |
It will generate several classes such as: | |
.m-r-10 which gives margin-right 10 pixels. | |
.m-r-15 gives MARGIN to the RIGHT 15 pixels. | |
.m-t-15 gives MARGIN to the TOP 15 pixels and so on. | |
.p-b-5 gives PADDING to the BOTTOM of 5 pixels | |
.p-l-40 gives PADDING to the LEFT of 40 pixels |