Skip to content

Instantly share code, notes, and snippets.

@Mukundhan-I2I
Mukundhan-I2I / java validations
Created May 6, 2020 14:49
java validations
https://www.sitepoint.com/using-java-bean-validation-method-parameters-return-values/
https://github.com/eugenp/tutorials
@Mukundhan-I2I
Mukundhan-I2I / AnnotaionBasedValidation
Created April 30, 2020 18:49
AnnotaionBasedValidation
https://stackoverflow.com/a/58822701/6769119
@Mukundhan-I2I
Mukundhan-I2I / httpclient.go
Last active April 14, 2020 07:13
httpclient.go
package client
import (
"yourpackage/model"
"bytes"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
@Mukundhan-I2I
Mukundhan-I2I / docker-cleanup-resources.md
Created April 10, 2020 14:43 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

/* eslint-disable import/no-extraneous-dependencies, prefer-template */
// const validateBoolOption = (name, value, defaultValue) => {
// if (typeof value === 'undefined') {
// value = defaultValue;
// }
// if (typeof value !== 'boolean') {
// throw new Error(`Preset react-app: '${name}' option must be a boolean.`);
// }
@Mukundhan-I2I
Mukundhan-I2I / findpom
Created February 14, 2020 15:55
findpom version
cat pom.xml | grep version | sed -n 3p | awk '{$1=$1;print}' | sed -E "s/(^<version>)(.+)(<\/version>)/\\2/g"

MySQL Download URL

https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz

Open the terminal and follow along:

  • Uninstall any existing version of MySQL
sudo rm /var/lib/mysql/ -R
@Mukundhan-I2I
Mukundhan-I2I / create_kinesis_stream.sh
Created January 25, 2020 23:05 — forked from etspaceman/create_kinesis_stream.sh
Local Kinesis Setup w/ LocalStack
#!/usr/bin/env bash
export $(cat .env | xargs)
KINESIS_STREAM_SHARDS=${KINESIS_STREAM_SHARDS:-1}
export USE_SSL=true
awslocal kinesis create-stream --shard-count ${KINESIS_STREAM_SHARDS} \
--stream-name ${KINESIS_STREAM_NAME}
@Mukundhan-I2I
Mukundhan-I2I / future and concurrent programming
Created December 26, 2019 05:16
future and concurrent programming in java
https://javarevisited.blogspot.com/2015/01/how-to-use-future-and-futuretask-in-Java.html
@Mukundhan-I2I
Mukundhan-I2I / nextTickPerSecond.js
Created December 24, 2019 16:00
node process.next tick unveiled
const start = Date.now();
let count = 0;
const tick = process.nextTick;
const log = () => {
count += 1;
if((Date.now() - start) !== 1000) {
tick(log);
} else {
console.log('ticks per second', count);
}