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
| Adding this to crontab enable you to pass the today date to an endpoint that you have to call sometimes | |
| 0 1 * * * wget https://api.example.com/example/`date +"\%Y-\%m-\%d"` |
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
| #Replace /usr/local/etc/nginx/nginx.conf with this. This is the | |
| # default location for Nginx according to 'nginx -h' | |
| worker_processes 1; | |
| error_log /etc/nginx/error.log; | |
| events { | |
| worker_connections 1024; | |
| } | |
| http { |
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
| 0xb668cF16d6819bcf9Dc0998a7A01e8e195EBEed2 |
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
| 0xceE5F58dBe0b8Cc1ee8E453daafF413429bfbBc5 |
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
| function slugify(text) { | |
| return text.toString().toLowerCase() | |
| .replace(/[\u00C0-\u00C5]/ig,'a') | |
| .replace(/[\u00C8-\u00CB]/ig,'e') | |
| .replace(/[\u00CC-\u00CF]/ig,'i') | |
| .replace(/[\u00D2-\u00D6]/ig,'o') | |
| .replace(/[\u00D9-\u00DC]/ig,'u') | |
| .replace(/[\u00D1]/ig,'n') | |
| .replace(/\s+/g, '-') // Replace spaces with - | |
| .replace(/[^\w\-]+/g, '') // Remove all non-word chars |
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
| #Replace /usr/local/etc/nginx/nginx.conf with this. This is the | |
| # default location for Nginx according to 'nginx -h' | |
| worker_processes 1; | |
| error_log /usr/local/var/log/nginx/error.log; | |
| events { | |
| worker_connections 1024; | |
| } | |
| http { |
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
| function isInArray(value, array) { | |
| return array.indexOf(value) > -1; | |
| } |
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
| function deleteElement(elem, array){ | |
| let _array = []; | |
| for (let i = 0; i < array.length; i++) { | |
| if(array[i] != elem){ | |
| _array.push(array[i]); | |
| } | |
| } | |
| return _array; | |
| } |
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
| const fs = require('fs'); | |
| const path = require('path'); | |
| /** | |
| * @param ctx - Koa context (this) (required) | |
| * @param file - contain file information (required) | |
| * @param file.fileType - contain file type information such as application/pdf || image/jpg and so on.. | |
| * @param file.filePath - contain the private file path | |
| */ |
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
| function pickReplace(obj, objPick){ | |
| let no = {}; | |
| for(let k of objPick){ | |
| if(k in obj){ | |
| no[k] = obj[k]; | |
| } | |
| } | |
| return no; | |
| } |
NewerOlder