# edit locales and add Chinese
vim /etc/locale.gen
locale-gen
dpkg-reconfigure locales
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 shift = (cypherShift, alphabet, messageChar) => { | |
| const charCode = (ch) => ch.toLowerCase().charCodeAt(0); | |
| let begin = charCode(alphabet.from); | |
| let end = charCode(alphabet.to); | |
| [begin, end] = (begin > end) ? [end, begin] : [begin, end]; | |
| const alphabetLength = end - begin; | |
| const shiftLength = cypherShift % alphabetLength; | |
| if (alphabetLength === 0) return messageChar; |
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
| /** | |
| * Adds scripts on page without CORS to use additional scripts from CDN | |
| * Creates scripts inside <head> tag | |
| * | |
| * @license MIT | |
| * @copyright Sergei Osipov 2017 | |
| */ | |
| ((cdnList) => { | |
| cdnList |
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
| # | |
| # Acts as a nginx HTTPS proxy server | |
| # enabling CORS only to domains matched by regex | |
| # /https?://.*\.mckinsey\.com(:[0-9]+)?)/ | |
| # | |
| # Based on: | |
| # * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html | |
| # * http://enable-cors.org/server_nginx.html | |
| # | |
| server { |
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 atob = a => new Buffer(a, 'base64').toString('binary'); | |
| const btoa = b => new Buffer(b).toString('base64'); |
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
| <html> | |
| <head> | |
| <meta charSet="utf-8"> | |
| <title>Hello world</title> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/react/17.0.0/umd/react.production.min.js"></script> | |
| <script src="https://unpkg.com/react-dom@17.0.0/umd/react-dom.production.min.js"></script> | |
| <script src="https://unpkg.com/@babel/standalone/babel.min.js"> | |
| </script> | |
| </head> | |
| <body> |