This file contains 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
// # Requirement | |
// * `npm i form-data` | |
// # Test on node 14 | |
-- | |
import axios from 'axios' | |
import * as fs from 'fs' | |
import * as FormData from 'form-data' |
This file contains 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 replacer(key, value) { | |
if (typeof value === 'string') { | |
//to avoid ///" | |
//add space to , and : | |
return value.replace(/"/g, '').replace(/,/g, ', ').replace(/:/g, ': ') | |
} else { | |
return value | |
} | |
} | |
const jsonData = JSON.stringify(data, replacer) |
- You need to define type to each object if it does not exist then you need to create an
interface
. - It is what I do every now and then when developing Android app. Yet, developing in Javascript made my lazy.
- A new library may need to add a babel plugin to the
.babelrc
first. - You cannot just add a new line. Don't forget to add a dependency, too.
- image - a snapshot of environment that just work. E.g.,
node10:alpine
This is a super small linux (alpine) os with node10 installed. - container - a running instance of an image. You can
build
container into an image and distribute the image. - port
-p 4000:80
(when using command line.)
- "4000:80"
This file contains 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
sudo chown -R username:group node_modules |
This file contains 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
#SonarQube | |
## Requirements | |
* Your project - Your codes that you want to analyse | |
* SonarQube Server - Place where analysis result will stay. You need to deploy it. | |
* SonarQube Scanner - the analyser. Install by `brew install sonar-scanner`. | |
## Configurations | |
* create `sonar-project.properties` and put it at the root. | |
Example of the file is as belows: |
This file contains 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
pragma solidity ^0.4.18; | |
// ---------------------------------------------------------------------------- | |
// 'Tanapruk' token contract | |
// | |
// Deployed to : 0xAe53EeAd0eE4c28FA838dAc87Cd6c0D9749Fb829 | |
// Symbol : TANAP | |
// Name : TANAP Token | |
// Total supply: 100000000 | |
// Decimals : 18 |
NewerOlder