Skip to content

Instantly share code, notes, and snippets.

View AyemunHossain's full-sized avatar
🔥
Email me for your first open source contribution

Ayemun Hossain AyemunHossain

🔥
Email me for your first open source contribution
View GitHub Profile
@AyemunHossain
AyemunHossain / kineticCss.html
Last active August 28, 2024 04:45
Kinetic Css Loader
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"
integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
@AyemunHossain
AyemunHossain / cmd.txt
Created August 17, 2024 10:49
Install Node with nvm
sudo apt install curl
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.bashrc
nvm install 16.19.0
@AyemunHossain
AyemunHossain / nodeSocketRedisExample.txt
Created June 5, 2024 05:08
Nodejs Socket and redis example
1. Install dependencies:
npm install express socket.io redis
2. Nodejs Code:
const express = require('express');
const http = require('http');
const socketIo = require('socket.io');
const redis = require('redis');
@AyemunHossain
AyemunHossain / csvToReadmeQuestionAnswer.py
Created February 19, 2024 11:07
Convert CSV file to Githubreadme question answer pattern
import csv
# Read the CSV file
def read_csv(file_path):
rows = []
with open(file_path, newline='', encoding='utf-8') as csvfile:
reader = csv.reader(csvfile)
header = next(reader) # Skip header
for row in reader:
rows.append(row)
@AyemunHossain
AyemunHossain / shuffleCSV.py
Created February 15, 2024 08:11
Shuffle a csv file rows
import csv
import random
def clean_csv(input_file, output_file):
# Open the input CSV file for reading
with open(input_file, 'r', newline='') as csvfile:
reader = csv.reader(csvfile)
# Read all rows except the header
rows = list(reader)[1:]
@AyemunHossain
AyemunHossain / cheatsheet-elasticsearch.md
Last active October 10, 2023 09:03 — forked from ruanbekker/cheatsheet-elasticsearch.md
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
@AyemunHossain
AyemunHossain / file-upload-to-s3.js
Created September 14, 2023 11:30
Get all files form a directory and upload them s3
const directoryPath = __dirname;
const fs = require('fs');
const path = require('path');
const AWS = require('aws-sdk');
AWS.config.update({
endpoint: new AWS.Endpoint("**********************"),
accessKeyId: "**********************",
secretAccessKey: "********************",
});
const s3 = new AWS.S3();
@AyemunHossain
AyemunHossain / allCountryWithShortNameAndFullName.txt
Created September 14, 2023 05:28
All Country with short and full name
{
"ad": "Andorra",
"ae": "United Arab Emirates",
"af": "Afghanistan",
"ag": "Antigua and Barbuda",
"ai": "Anguilla",
"al": "Albania",
"am": "Armenia",
"ao": "Angola",
"aq": "Antarctica",
@AyemunHossain
AyemunHossain / changeFileName.js
Created September 14, 2023 05:25
Change file name in Nodejs
const fs = require('fs');
const path = require('path');
const directoryPath = __dirname;
// Read the contents of the directory
fs.readdir(directoryPath, (err, files) => {
if (err) {
console.error('Error reading directory:', err);
return;
}
@AyemunHossain
AyemunHossain / github-cli.sh
Created August 27, 2023 11:02
Github cli install and login
# Install github cli
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
# Login with github cli