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
require('dotenv').config() | |
const { | |
DynamoDBClient, | |
PutItemCommand, | |
UpdateItemCommand, | |
DeleteItemCommand, | |
GetItemCommand | |
} = require('@aws-sdk/client-dynamodb') // ^3.264.0 |
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
const chokidar = require('chokidar'); | |
const fs = require('fs'); | |
const path = require('path') | |
const ncp = require('ncp').ncp | |
let data = fs.readFileSync(path.join(__dirname, 'package.json'), { | |
encoding: "utf-8", | |
flag:'r' | |
}) | |
let watch = true |
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 (){ | |
console.log('Calculating...') | |
let index = 0 | |
let test_seconds = 2 | |
let start_time = Date.now() | |
let interval_time = 0 | |
while(interval_time - start_time <= test_seconds * 1000){ | |
interval_time = Date.now() | |
index++ | |
} |
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
const express = require('express') | |
const app = express() | |
const port = 80 | |
const ip = '127.0.0.1' | |
app.use(express.static('./')) | |
let setCache = function (req, res, next) { | |
res.set('Cache-control', `no-store`) | |
next() |
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
let getParam = (p) => { | |
let obj = {} | |
let param = window.location.search.split('?') | |
param = param[1] | |
if(!param) return false | |
param.split('&').forEach(el => { | |
let element_arr = el.split('=') | |
obj[element_arr[0]] = element_arr[1] | |
}); | |
return obj[p] ? obj[p] : false |
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
var isIE = function(ver) { | |
var b = document.createElement('b'); | |
b.innerHTML = '<!--[if IE ' + ver + ']><i></i><![endif]-->'; | |
return b.getElementsByTagName('i').length === 1; | |
} |