Skip to content

Instantly share code, notes, and snippets.

View KunalSin9h's full-sized avatar

Kunal Singh KunalSin9h

View GitHub Profile
@KunalSin9h
KunalSin9h / bash_script_color.sh
Created August 29, 2022 07:53
This is colour output snippet for shell script.
#!/bin/bash
# Reset
Color_Off=''
# Regular Colors
Red=''
Green=''
Yellow=''
Cyan=''
@KunalSin9h
KunalSin9h / stress.bat
Created September 11, 2022 03:13
Windows batch file for stress testing.
@echo off
gen > in
slow < in > slow_out
fast < in > fast_out
fc slow_out fast_out
if errorlevel 1 exit
test
@KunalSin9h
KunalSin9h / stress.sh
Created September 11, 2022 03:17
Linux shell script for stress testing.
#!/usr/bin/bash
RED='\e[0;31m' #red color
NC='\e[0m' # no color
GREEN='\e[0;32m' # green
YELLOW='\e[0;33m' # yello
CYAN='\e[0;36m' # cyan
for((i = 1; i <= $4 ; ++i)); do
./$3 > input
@KunalSin9h
KunalSin9h / latest_version.com
Created October 5, 2022 18:41
Bash Script to get the latest release of any repository of any user.
# get latest release from github
LATEST_RELEASE=$(curl -s https://api.github.com/repos/username/repo_name/releases/latest | grep "tag_name" | cut -d '"' -f 4)
import React, { Component } from "react";
import { Link } from "react-router-dom";
export default class ErrorBoundary extends Component {
state = { hasError: false };
// whenever an error happens this function will be invoked by React to
// no object will be created that's why static method
static getDerivedStateFromError() {
return { hasError: true };
import { Component } from "react";
export default class ErrorBoundary extends Component {
state = { hasError: false };
// whenever an error happens this function will be invoked by React to
// no object will be created that's why static method
static getDerivedStateFromError() {
return { hasError: true };
}
server {
    server_name your_domain www.your_domain;
    
    client_max_body_size 20M;

    location / {
        proxy_pass http://localhost:9990;
    }
}

Postgres Bind mount permissio denied

 sudo chown -R 1000:1000 ./data 
Build in ways to check the code coverage in golang!
# These are the fixex for general Docker swarn problems