We’ll configure one MySQL instance as the source database and another as its replica. Replication allows data synchronization between these separate databases.
- Obviously install MySQL on 2 servers.
Make sure Windows leaves your line endings alone. This way you can still run shell scripts and things in Git Bash or WSL:
git config --global core.autocrlf input
Next, after committing any changes you do not have staged, run these:
git rm --cached -r .
git reset --hard
const SpotifyWebApi = require('spotify-web-api'); | |
const fs = require('fs'); | |
const os = require('os'); | |
const readline = require('readline'); | |
const spotify = new SpotifyWebApi({ | |
clientId: 'YOUR_CLIENT_ID', | |
clientSecret: 'YOUR_CLIENT_SECRET', | |
redirectUri: 'http://localhost:3000', | |
}); |
@echo off | |
set local | |
set runas=runas /user:Administrator | |
%runas% "c:\program files\reaper.exe" | |
%runas% explorer.exe |
const nlp = require("compromise"); | |
const nameParser = require("name-parser"); | |
// Function to determine the name format | |
function determineNameFormat(name) { | |
// Patterns to match different name formats | |
const firstLast = nlp(name).match("#Honorific #FirstName #LastName").out("array"); | |
const lastFirst = nlp(name).match("#LastName, #FirstName #Honorific").out("array"); | |
const middleName = nlp(name).match("#FirstName #MiddleName #LastName").out("array"); | |
const middleInitial = nlp(name).match("#FirstName #MiddleInitial #LastName").out("array"); |
Here is an example of using JavaScript generators to handle multiple HTTP requests in a sequential manner:
const fetch = require("node-fetch");
function* fetchUsers() {
const user1 = yield fetch("https://jsonplaceholder.typicode.com/users/1");
const user2 = yield fetch("https://jsonplaceholder.typicode.com/users/2");
const Container = { | |
_storage: {}, | |
register(key, deps, func) { | |
this._storage[key] = { deps, func }; | |
}, | |
get(key) { | |
if (!this._storage[key]) throw new Error(`Missing ${key}`); | |
const { func, deps } = this._storage[key]; | |
return (...args) => { | |
const resolvedDeps = deps.map((key) => this.get(key)); |