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
/** | |
* today: Get the current date | |
*/ | |
exports.today = () => new Date(); | |
// main.js | |
const { today } = require("./date"); | |
console.log(today()); // 2021-08-22T15:59:47.482Z |
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/python3 | |
import json | |
from urllib.request import urlopen | |
import random | |
def print_logo(): printline(""" | |
_________ __ __________ __ | |
/_ __/ _ \/ / / /_ __/ // / |
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
[ | |
{ | |
"id": "0", | |
"level": "2", | |
"summary": "I dare you to Stand up for 2 turns", | |
"time": "", | |
"turns": "2", | |
"type": "Dare" | |
}, | |
{ |
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 React, { useEffect, useState } from "react"; | |
import { Document, Page } from "react-pdf/dist/esm/entry.webpack"; | |
import "./App.css"; | |
let fnGetFileNameFromContentDispostionHeader = function (header: string = "") { | |
let contentDispostion = header.split(";"); | |
const fileNameToken = `filename*=UTF-8''`; | |
let fileName = "downloaded.pdf"; | |
for (let thisValue of contentDispostion) { | |
if (thisValue.trim().indexOf(fileNameToken) === 0) { | |
fileName = decodeURIComponent( |
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 fill = function* (start = 0, end = 100, filter = (_) => true, mapper = (x) => x) { | |
while (start < end) { | |
if (filter(start)) | |
yield start; | |
mapper(start++); | |
} | |
}; | |
const isEven = (num) => num % 2 === 0; | |
const isOdd = (num) => num % 2 !== 0; | |
const evens = [...fill(0, 100, isEven)]; |
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
# Forget about JMeter, Start writing K6 scripts for Load Testing and Performance Monitoring | |
Performance testing or monitoring is not new to us. Whenever we create an API, We do need testing. For code and components, We write unit tests and integration tests. However, for performance, We need to load test and monitor the result. | |
A Gist page for article: [Forget about JMeter, Start writing K6 scripts for Load Testing and Performance Monitoring](https://medium.com/@deepak-v/writing-k6-scripts-for-load-testing-and-performance-monitoring-25cb2aefa23c) |
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
// app/index.js | |
const fastify = require("fastify")({ logger: false }); | |
// Take port from env variable | |
const PORT = process.env.PORT || 3000; | |
// Create user database | |
const users = Array(100) | |
.fill(0) | |
.map((_, x) => ({ | |
name: `User_${x}`, | |
id: `ID_${x}`, |
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
[ | |
{ | |
"title": "Easy To Say", | |
"href": "https://www.instagram.com/p/B0_guFApVon/", | |
"body": "It’s always easy to say,\nI do nothing, It’s my job.\nIt’s always easy to say,\nI do nothing, Just earn money to spend on.\nIt’s always easy for you,\nTo break my faith and courage that I make.\nYes, I am Man. Carrying all the pain, still smiling.\nYes, This is my job.\nIt’s always easy to say,\nYou carry my child and raise for so long.\nI did nothing, just gave a name and that’s all.\nIt’s always easy for you to say,\nYou make a living place home.\nYes, I know you do lot of things,\nThat why I try keep all my pain away so you can focus more.\nI do all dirty fight for you, so that you and our love ones can live more.\nYes you can say, I give just a name.\nBut I want people think before they try to harm you more.\nYes, I am Man. I don’t know.\nHow to say, It’s not easy to say I care, I care a lot.||" | |
}, | |
{ | |
"title": "Lady in the dark", | |
"href": "https://www.instagram.com/p/B7FHYKaJ6dR/", |