Skip to content

Instantly share code, notes, and snippets.

View Tanapruk's full-sized avatar
🎯
Focusing

Tanapruk Tanapruk

🎯
Focusing
View GitHub Profile
@Tanapruk
Tanapruk / call-line-notify.ts
Created November 16, 2021 08:11
axios in node.js call line notify to send image
// # Requirement
// * `npm i form-data`
// # Test on node 14
--
import axios from 'axios'
import * as fs from 'fs'
import * as FormData from 'form-data'
@Tanapruk
Tanapruk / grid.md
Last active July 20, 2019 12:24
CSS Grid Resources
@Tanapruk
Tanapruk / jsoner.js
Created March 1, 2019 08:44
JSON.stringify remove slash double slash
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)
@Tanapruk
Tanapruk / nextjs.md
Created February 23, 2019 14:27
nextJS + Typescript development encounter.

Typescript Linting

  • 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.

Babel configurations

  • 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.
@Tanapruk
Tanapruk / note.md
Last active February 19, 2019 14:09
Docker

Docker

Docker's Concepts

  • 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"
@Tanapruk
Tanapruk / file.sh
Created December 20, 2018 15:33
Error writing to node_modules
sudo chown -R username:group node_modules
@Tanapruk
Tanapruk / setup.md
Last active December 12, 2018 11:38
bin's devOps Workshop

create VPC

Instance Installation

Install NodeJS

  • curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash
  • . ~/.nvm/nvm.sh
  • nvm install 10.14.2
  • node -e "console.log('Running Node.js ' + process.version)"
@Tanapruk
Tanapruk / note.md
Last active July 18, 2018 10:13
Slack API & stdlib

Project Structure of stdlib

functions
├── __main__.js
├── actions
│   ├── __main__.js
│   └── example.js
├── commands
│   ├── __main__.js
@Tanapruk
Tanapruk / gist:662d4fc761d12c87bad62cc883aab533
Created May 28, 2018 08:20
Sonarqube Setup Guides for Typescript/Javascript
#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:
pragma solidity ^0.4.18;
// ----------------------------------------------------------------------------
// 'Tanapruk' token contract
//
// Deployed to : 0xAe53EeAd0eE4c28FA838dAc87Cd6c0D9749Fb829
// Symbol : TANAP
// Name : TANAP Token
// Total supply: 100000000
// Decimals : 18