π
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
| #!/usr/bin/env node | |
| const fs = require("fs"); | |
| const buildAt = new Date().toISOString(); | |
| const buildEnv = process.env.ENVIRONMENT; | |
| main(); | |
| function main() { |
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
| // npm i -S pino | |
| // npm i -D pino-pretty | |
| import pino from "pino"; | |
| const { LOG_LEVEL = "debug", APP_NAME = "Web" } = process.env; | |
| const isProduction = process.env.NODE_ENV === "production"; | |
| const logger = pino({ | |
| name: APP_NAME, |
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 Koa, { Context } from "koa"; | |
| import bodyParser from "@koa/bodyparser"; | |
| import registerRoutes from "./routers"; | |
| import Jwt from "koa-jwt"; | |
| const { THIRD_PARTY_APP_JWT_SECRET = "" } = process.env; | |
| const koaApp = new Koa(); | |
| koaApp.use(bodyParser()); | |
| koaApp.use(async (ctx: Context, next) => { |
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
| ps aux | grep -i 3000 | grep -v grep | awk {'print $2'} | xargs kill -9 |
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
| INSTANCE_NAME=nucleus-jumphost-570 | |
| PORT=8080 | |
| REGION=us-west4 | |
| ZONE=us-west4-a | |
| FIREWALL_RULE=allow-tcp-rule-698 | |
| # setup | |
| gcloud config set compute/zone $ZONE | |
| gcloud config set compute/region $REGION |
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
| package com.pragmatists.blog.events.application; | |
| import java.util.Random; | |
| import java.util.function.Function; | |
| import java.util.function.Supplier; | |
| public class HOFSampleToro { | |
| public static void main(String[] args) { |
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
| <plugin> | |
| <groupId>com.diffplug.spotless</groupId> | |
| <artifactId>spotless-maven-plugin</artifactId> | |
| <version>2.24.0</version> | |
| <configuration> | |
| <formats> | |
| <format> | |
| <includes> | |
| <include>*.md</include> | |
| <include>.gitignore</include> |
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
| @baseUrl = {{$dotenv SERVICE_API_ENDPOINT}} | |
| @accessToken = {{$dotenv SERVICE_API_ACCESS_TOKEN}} | |
| ### Health-check | |
| GET {{baseUrl}}/health | |
| ### Media | |
| ### Create media upload url | |
| ## This endpoint return a JSON { data : "signedUrl" } |
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 NUMERALS = [ | |
| { value: 1000000000000000000000, str: 'sextillion' }, | |
| { value: 1000000000000000000, str: 'quintillion' }, | |
| { value: 1000000000000000, str: 'quadrillion' }, | |
| { value: 1000000000000, str: 'trillion' }, | |
| { value: 1000000000, str: 'billion' }, | |
| { value: 1000000, str: 'million' }, | |
| { value: 1000, str: 'thousand' }, | |
| { value: 100, str: 'hundred' }, | |
| { value: 90, str: 'ninety' }, |
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
| // AVN TOKEN | |
| pragma solidity ^0.6.12; | |
| // SPDX-License-Identifier: MIT | |
| interface IERC20 { |