Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Nguyễn Nhật Hoàng codeaholicguy

🎯
Focusing
View GitHub Profile
View IntegerToEnglish.js
const Notions = {
1: 'Thousand',
2: 'Million',
3: 'Billion',
}
const UnderTwenty = {
0: '',
1: 'One',
2: 'Two',
View test.js
const w = {
100: 'Hundred',
1000: 'Thousand',
1000000: 'Million',
1000000000: 'Billion'
}
const ww = {
1: 'One',
2: 'Two',
View main.yml
name: main
on:
# Cho phép chạy bằng tay từ giao diện Github
workflow_dispatch:
# Lên lịch chạy hàng ngày vào lúc 00:00 UTC
schedule:
- cron: "0 0 * * *"
jobs:
View index.js
const axios = require("axios");
const fs = require("fs");
const getQuote = async () => {
try {
const { data } = await axios.get("https://quotes.rest/qod?language=en");
const quote = data.contents.quotes[0].quote;
const author = data.contents.quotes[0].author;
console.log("new quote", `"${quote}"`);
View quotes.json
{
"success": {
"total": 1
},
"contents": {
"quotes": [
{
"quote": "Ideas don't get smaller when they're shared, they get bigger.",
"length": "61",
"author": "Seth Godin",
View test.json
{
"fbPageId": "1093212670720847",
"campaign": {
"id": 1,
"pageId": 4,
"name": "Test campaign",
"description": "Test campaign",
"campaignGroupId": null,
"launchAt": null,
"isNewsLetter": true,
View campaign.js
{
contents: [
{
id: 1,
order: 1,
text: 'Xin chào',
links: []
},
{
id: 2,
View docker-compose.yml
version: "3"
services:
app:
build: .
ports:
- "3000:3000"
environment:
- MONGO_URL=mongodb://mongo:27017
depends_on:
- mongo
View docker-compose.yml
version: "3"
services:
app:
build: .
ports:
- "3000:3000"
environment:
- MONGO_URL=mongodb://mongo:27017
depends_on:
- mongo
View Dockerfile
FROM node:8
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
COPY package*.json ./
RUN npm install
# Copy app source code