Skip to content

Instantly share code, notes, and snippets.

View rimrachai-marma's full-sized avatar

Rimrachai Marma rimrachai-marma

  • Khagrachari, Chittagong, Bangladesh
View GitHub Profile
name: Deploy to AWS EKS
on:
push:
branches:
- main
pull_request:
branches:
- main
@rimrachai-marma
rimrachai-marma / asyncReduce.js
Last active September 6, 2023 20:14
async reduce
async function asyncReduce(array, asyncReducerFunction, initialValue) {
let accumulator = initialValue;
for (const element of array) {
accumulator = await asyncReducerFunction(accumulator, element);
}
return accumulator;
}
@rimrachai-marma
rimrachai-marma / pagination.js
Last active September 6, 2023 20:16
generate pagination
let page = 15;
let pages = 50;
let pageNumbers = [];
for (let i = page - 3; i <= page + 3; i++) {
if (i < 1) continue;
if (i > pages) break;
@rimrachai-marma
rimrachai-marma / server.py
Created July 24, 2020 02:55 — forked from davidbgk/server.py
An attempt to create the simplest HTTP Hello world in Python3
import http.server
import socketserver
from http import HTTPStatus
class Handler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
self.send_response(HTTPStatus.OK)
self.end_headers()
self.wfile.write(b'Hello world')