Skip to content

Instantly share code, notes, and snippets.

View arindam89's full-sized avatar

Arindam Paul arindam89

  • Chief Architect at Safe Security
  • Bengaluru, India
  • 19:26 (UTC +05:30)
  • X @geek_paul
View GitHub Profile
@arindam89
arindam89 / PlayStationBIOSFilesNAEUJP.md
Created November 23, 2023 13:14 — forked from juanbrujo/PlayStationBIOSFilesNAEUJP.md
Files for PlayStation BIOS Files NA-EU-JP
@arindam89
arindam89 / app.go
Last active February 1, 2023 04:35
Zap Log Samplers Example
// Sampled Logs with 10% logging
import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
func main() {
logger, _ := zap.NewProduction()
sampled := zap.WrapCore(func(c zapcore.Core) zapcore.Core {
@arindam89
arindam89 / README.md
Created July 14, 2020 11:24
DS Problem 1

Number of Islands

Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.

Example 1

Input: grid = [
  ["1","1","1","1","0"],
 ["1","1","0","1","0"],
docker-compose run --service-ports prometheus_demo
@arindam89
arindam89 / docker-compose.yml
Created May 8, 2020 03:02
Docker Compose File
version: '3'
services:
prometheus_demo:
build: .
ports:
- "9100:9100"
- "9090:9090"
- "3000:3000"
- "9093:9093"
@arindam89
arindam89 / Dockerfile
Last active May 8, 2020 04:48
Dockerfile for Prometheus Setup
FROM ubuntu:bionic
MAINTAINER Arindam Paul, arindampaul1989@gmail.com
RUN apt-get update \
&& apt-get install -y wget \
&& apt-get install -y screen \
&& apt-get install -y vim
WORKDIR /root
RUN wget -nv https://github.com/prometheus/prometheus/releases/download/v2.18.0/prometheus-2.18.0.linux-amd64.tar.gz
@arindam89
arindam89 / vavr_expressive_error_handling.java
Created April 25, 2020 12:32
Error Handling Example Real World
interface CustomerProvider {
List<String> getPersonalRecomendations(final String customerId) throws IOException,IllegalArgumentException;
}
interface GenericSuggestionProvider {
List<String> getGeneralRecomendations() throws IOException;
}
interface CacheSuggestionProvider {
List<String> getCachedRecomendations();
// = Success(result) or Failure(exception)
Try<Integer> divide(Integer dividend, Integer divisor) {
return Try.of(() -> dividend / divisor);
}
@Test
public void createTry() {
System.out.println(divide(10,2));
System.out.println(divide(10,0));
}
@arindam89
arindam89 / either_example.java
Created April 25, 2020 10:04
Either Example
// = Right(result) or Left(exception)
Either<Exception, Integer> divideEither(Integer dividend, Integer divisor) {
try {
return Either.right(dividend / divisor);
} catch (Exception e) {
return Either.left(e);
}
}
@Test
@arindam89
arindam89 / either_naive.java
Created April 25, 2020 10:03
Either Naive Example
// = Right(result) or Left(exception)
Either<Exception, Integer> divideEither(Integer dividend, Integer divisor) {
return Either.right(dividend / divisor);
}
@Test
public void createEither() {
System.out.println(divideEither(10,2));
System.out.println(divideEither(10,0));
}