Skip to content

Instantly share code, notes, and snippets.

View frhan's full-sized avatar

Farhan Faruque frhan

View GitHub Profile
Task: Build a Secure File Upload Component
Objective:
Create a reusable React component for secure file upload with the following features:
File Preview: Show a thumbnail preview for images and file icons for other types.
File Size Limit: Enforce a 10 MB file size limit with a clear error message.
Drag and Drop Support: Allow users to drag and drop files.
@frhan
frhan / docker-compose.yml
Last active April 13, 2023 22:31
Docker monitoring
version: 3.3
@frhan
frhan / java.md
Last active December 7, 2022 00:54
Java

Java Update alternatives

Screenshot from 2022-11-14 11-47-15

@frhan
frhan / nginx.md
Last active December 7, 2022 00:53
Basic nginx command

Reload Nginx

nginx -s reload

validate Nginx

nginx -s reload

Reverse proxy config

Screenshot from 2022-12-06 01-12-31

@frhan
frhan / Docker.md
Last active January 18, 2023 11:06
Docker basic commands

How to get docker-compose to always re-create containers from fresh images?

Screenshot from 2023-01-18 12-05-23

Purging All Unused or Dangling Images, Containers, Volumes, and Networks

$ docker system prune

Remove any stopped containers and all unused images

$ docker system prune -a

@frhan
frhan / tar.md
Last active December 6, 2022 23:47
How to create tar.gz file in Linux using command line

create tar.gz file in Linux

tar -czvf file.tar.gz directory

Verification

$ tar -ztvf projects.tar.gz

extract a tar.gz compressed archive on Linux

$ tar -xvf file.tar.gz
$ tar -xzvf file.tar.gz
package me.ff.jtest;
public class Test2 {
static void solution(int n){
String [] result = new String[n+1];
for (int i=1;i<=n; i++){
result[i] = "";
import java.util.LinkedHashMap;
import java.util.Map;
public class MaxSizeHashMap<K, V> extends LinkedHashMap<K, V> {
private final int maxSize;
public MaxSizeHashMap(int maxSize) {
super(maxSize);
this.maxSize = maxSize;
}
@frhan
frhan / fp.js
Created September 5, 2019 12:20
Very Basic of Function Programming in JS
var stream = {
map: function (list, fn) {
var newList = [];
for (item in list) {
var mappedItem = fn(list[item]);
newList.push(mappedItem);
}
return newList;
},
filter: function (list, predicate) {