sudo vi /etc/yum.repos.d/mongodb-org-3.6.repo
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
| Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna! | |
| ([一-龯]) | |
| Regex for matching Hirgana or Katakana | |
| ([ぁ-んァ-ン]) | |
| Regex for matching Non-Hirgana or Non-Katakana | |
| ([^ぁ-んァ-ン]) | |
| Regex for matching Hirgana or Katakana or basic punctuation (、。’) |
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
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Sid": "AllowAdminAccess", | |
| "Effect": "Allow", | |
| "Action": "*", | |
| "Resource": "*" | |
| }, | |
| { |
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 streamS3File = async (request, response) => { | |
| const data = JSON.parse(request.body); | |
| const params = { | |
| Bucket: data.bucket, | |
| Key: data.key, | |
| } | |
| // fetch file meta. it's not propagated from the S3 SDK | |
| const meta = await s3.headObject(params).promise(); |
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 mergeObjects = (contents) => { | |
| // Create an object with all the keys in it | |
| // This will return one object containing all keys the items | |
| let result = {}; | |
| // Create an object with all keys set to the default value ('') | |
| contents.forEach((item) => { | |
| result = _.merge(result, item); | |
| }); |
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
| import Encoding from 'encoding-japanese'; | |
| // https://0g0.org/category/2E80-2EFF/1/ | |
| export const findNonSJISCharacters = (data: string) => { | |
| // get current encoding of input. | |
| const detectedOrg = Encoding.detect(data); | |
| return [...(data || '')].filter((char) => { | |
| const ucd = char.charCodeAt(0); | |
| // convert current code to SJIS |
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 ipLookUp () { | |
| $.ajax('http://ip-api.com/json') | |
| .then( | |
| function success(response) { | |
| console.log('User\'s Location Data is ', response); | |
| console.log('User\'s Country', response.country); | |
| getAdress(response.lat, response.lon) | |
| }, | |
| function fail(data, status) { |
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
| frontend: | |
| customHeaders: | |
| # cache static assets! (can I just use a glob for this, e.g., '**/*.{js,css,gif,ico,jpg,png,svg,mp4,webm}' ?) | |
| # js | |
| - pattern: '**/*.js' | |
| headers: [ { key: 'Cache-Control', value: 'public,max-age=31536000,immutable' } ] | |
| # css | |
| - pattern: '**/*.css' | |
| headers: [ { key: 'Cache-Control', value: 'public,max-age=31536000,immutable' } ] | |
| # images |
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
| # Update the installed packages and package cache on your instance. | |
| sudo yum update -y | |
| # Install the most recent Docker Engine package | |
| ## Amazon Linux 2 | |
| sudo amazon-linux-extras install docker | |
| ## Amazon Linux | |
| # sudo yum install docker | |
| # Start the Docker service. |
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
| Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna! | |
| ([一-龯]) | |
| Regex for matching Hirgana or Katakana | |
| ([ぁ-んァ-ン]) | |
| Regex for matching Non-Hirgana or Non-Katakana | |
| ([^ぁ-んァ-ン]) | |
| Regex for matching Hirgana or Katakana or basic punctuation (、。’) |