This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command
$ docker-compose up -d
# To Tear Down
$ docker-compose down --volumes
| const fs = require("fs"); | |
| const path = require("path"); | |
| const folderPath = __dirname + "/MBall_sections_applx_RAs_MARKUP"; | |
| const outputFolderPath = __dirname + "/conclusion"; | |
| fs.readdir(folderPath, (err, files) => { | |
| if (err) { | |
| console.error("Error reading folder:", err); | |
| return; |
| /* nếu screen <= 1440px */ | |
| @media only screen and (max-width: 1440px) { | |
| } | |
| /* nếu screen <= 1366px */ | |
| @media only screen and (max-width: 1366px) { | |
| /** | |
| * injectScript - Inject internal script to available access to the `window` | |
| * | |
| * @param {type} file_path Local path of the internal script. | |
| * @param {type} tag The tag as string, where the script will be append (default: 'body'). | |
| * @see {@link http://stackoverflow.com/questions/20499994/access-window-variable-from-content-script} | |
| * @reference https://gist.github.com/devjin0617/3e8d72d94c1b9e69690717a219644c7a?permalink_comment_id=3766826#gistcomment-3766826 | |
| */ | |
| function injectScript(file_path, tag) { | |
| var node = document.getElementsByTagName(tag)[0]; |
| const StreamArray = require('stream-json/streamers/StreamArray'); | |
| const fs = require('fs'); | |
| let combine = "Working_Vietnamese_English_Combined.json"; | |
| let vnedict = `vnedict__vietnamese-english.json` | |
| const jsonStream = StreamArray.withParser(); | |
| fs.createReadStream(vnedict).pipe(jsonStream.input); |
| [aAàÀảẢãÃáÁạẠăĂằẰẳẲẵẴắẮặẶâÂầẦẩẨẫẪấẤậẬbBcCdDđĐeEèÈẻẺẽẼéÉẹẸêÊềỀểỂễỄếẾệỆfFgGhHiIìÌỉỈĩĨíÍịỊjJkKlLmMnNoOòÒỏỎõÕóÓọỌôÔồỒổỔỗỖốỐộỘơƠờỜởỞỡỠớỚợỢpPqQrRsStTuUùÙủỦũŨúÚụỤưƯừỪửỬữỮứỨựỰvVwWxXyYỳỲỷỶỹỸýÝỵỴzZ]+ | |
| let vietnameseCharacters = `AÀẢÃÁẠĂẰẲẴẮẶÂẦẨẪẤẬBCDĐEÈẺẼÉẸÊỀỂỄẾỆGHIÌỈĨÍỊKLMNOÒỎÕÓỌÔỒỔỖỐỘƠỜỞỠỚỢPQRSTUÙỦŨÚỤƯỪỬỮỨỰVXYỲỶỸÝỴ` | |
| a | |
| ai | |
| am | |
| an | |
| ang | |
| anh | |
| ao | |
| au | |
| ay | |
| ba |
| function stringToSlug(str) { | |
| // remove accents | |
| var from = "àáãảạăằắẳẵặâầấẩẫậèéẻẽẹêềếểễệđùúủũụưừứửữựòóỏõọôồốổỗộơờớởỡợìíỉĩịäëïîöüûñçýỳỹỵỷ", | |
| to = "aaaaaaaaaaaaaaaaaeeeeeeeeeeeduuuuuuuuuuuoooooooooooooooooiiiiiaeiiouuncyyyyy"; | |
| for (var i=0, l=from.length ; i < l ; i++) { | |
| str = str.replace(RegExp(from[i], "gi"), to[i]); | |
| } | |
| str = str.toLowerCase() | |
| .trim() |
| async function getAudioFileFromEconomist(fileUrl) { | |
| const writer = fs.createWriteStream("economist_audio.mp3"); | |
| return axios({ | |
| method: "get", | |
| url: fileUrl, | |
| responseType: "stream", | |
| }).then((response) => { | |
| return new Promise((resolve, reject) => { | |
| response.data.pipe(writer); | |
| let error = null; |
| @Module({ | |
| imports: [ | |
| StoresModule, | |
| UserModule, | |
| TypeOrmModule.forRoot({ | |
| type: 'mysql', | |
| // "db" is the name of the service declared in docker-compose.yml, NOT localhost https://stackoverflow.com/questions/63492744/dockerize-nestjs-and-typeorm | |
| host: 'db', | |
| port: 3306, |