sudo service mysql stop
sudo mkdir -p /var/run/mysqld
sudo chown mysql:mysql /var/run/mysqld
sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &
mysql -u root
When a web page is opened in a browser, the browser will automatically execute JavaScript and generate dynamic HTML content. It is common to make HTTP request to retrieve the web pages. However, if the web page is dynamically generated by JavasSript, a HTTP request will only get source codes of the page. Many websites implement Ajax to send information to and retrieve data from server without reloading web pages. To scrape Ajax-enabled web pages without losing any data, one solution is to execute JavaScript using Python packages and scrape the web page that is completely loaded. Selenium is a powerful tool to automate browsers and load web pages with the functionality to execute JavaScript.
Selenium does not contain a web browser. It calls an API on a WebDriver which opens a browser. Both Firefox and Chrome have their own WebDrivers that int
<template> | |
<div class="tiptap-content"> | |
<editor-content :editor="editor" /> | |
</div> | |
</template> | |
<script> | |
import { | |
Editor, | |
EditorContent |
import useScrollRestoration from "utils/hooks/useScrollRestoration"; | |
const App = ({ Component, pageProps, router }) => { | |
useScrollRestoration(router); | |
return <Component {...pageProps} />; | |
}; | |
export default App; |
function firstReducer(state, action) { | |
if (action.type === 'LOGIN_PENDING') console.log('firstReducer log'); | |
return state; | |
} | |
function secondReducer(state, action) { | |
if (action.type === 'LOGIN_PENDING') console.log('secondReducer log'); | |
return state; | |
} |
This Gist works for CRA 3. For CRA 4, you can try community maintained craco plugin for converting to a single-spa application at https://github.com/hasanayan/craco-plugin-single-spa-application (thanks @hasanayan):
- Install react-app-rewired, as explained in https://github.com/timarney/react-app-rewired.
- Create a file in src called
single-spa-entry.js
(or tsx for typescript) - Modify config-overrides.js, as shown in the config-overrides.js file provided in this gist.
- (Optional) remove src/main.js, since single-spa-entry is the new entry
- (Optional) remove public/index.html, since single-spa applications share a single html file, instead of one html file per project.
- Create a file
Image.js
from the source below (it is almost a copy of Image.js from tiptap-extensions except that it has a constructor that acceptsuploadFunc
(function to be called withimage
being uploaded) and additional logicif(upload) { ... } else { ... previous base64 logic .. }
in thenew Plugin
section.
import {Node, Plugin} from 'tiptap'
import {nodeInputRule} from 'tiptap-commands'
/**
* Matches following attributes in Markdown-typed image: [, alt, src, title]
*
--- | |
# ----------------------------------------------------------------------------------------- | |
# Purpose: To manage system users: | |
# - create/upadate a user who is allowed accessing via ssh connection | |
# - add public ssh-key of user into its authorized_keys | |
# - allow user to use sudo by putting a config into /etc/sudoers.d/ | |
# - remove authorized_keys of inactive users | |
# - remove inactive users | |
# - remove sudo permission by removing its config file in /etc/sudoers.d/ if any | |
# Maintanance: Nghia Le [at] INFOTECHVIET |
export const space = [ | |
'var(--x1)', | |
'var(--x2)', | |
'var(--x3)', | |
'var(--x4)', | |
'var(--x5)', | |
'var(--x6)', | |
]; | |
export const fonts = { |
const _toQueryString = params => | |
`?${Object.entries(params) | |
.map( | |
([key, value]) => | |
`${encodeURIComponent(key)}=${encodeURIComponent(value)}` | |
) | |
.join("&")}`; | |
// EDIT here if you prefer a storage implementation or a store subscription etc. | |
// you could actually also remove the getToken function and directly call it in the header below |