Skip to content

Instantly share code, notes, and snippets.

View ucguy4u's full-sized avatar
🎯
Focusing

Uday Chauhan ucguy4u

🎯
Focusing
View GitHub Profile
@ucguy4u
ucguy4u / build7.gradle
Last active May 1, 2024 19:52
jacocoTestReport in Gradle 7 vs Gradle 8+
plugins {
id 'java'
...
id 'jacoco'
id 'jacoco-report-aggregation'
}
group = 'com.developerscoffee'
version = '1.0.0-SNAPSHOT'
sourceCompatibility = JavaVersion.VERSION_17
#!/bin/bash
# Input Parameters
REGISTRY_URL=${1:-"custom-registry.com"} # Default to asia-docker.pkg.dev if not provided
IMAGE_NAME=${2:-"user-service"}
TAG_BASE=${3:-"0.0"}
VERSION_FILE=${4:-"version.txt"}
# Check and create version file if not exists
if [ ! -f "$VERSION_FILE" ]; then
@ucguy4u
ucguy4u / dependencies.gradle
Created October 28, 2021 11:55
maintaining a common dependencies
repositories {
mavenCentral()
mavenLocal()
}
spotless {
java {
googleJavaFormat("1.7")
//indentWithTabs(1)
// indentWithSpaces(2)
@ucguy4u
ucguy4u / Employee.java
Created December 8, 2020 05:16
Inheritance example using getter and setters
class Bank {
private String bankName;
public Bank(String bankName) { // constructor
this.bankName = bankName;
}
public String getBankName() { // getter
return this.bankName;
}
@ucguy4u
ucguy4u / Inheritance.java
Last active December 8, 2020 05:04
eg: Inheritance in Java
class Teacher {
String designation = "Teacher";
String collegeName = "CMU";
void does() {
System.out.println("teaching");
}
}
public class MathsTeacher extends Teacher {
@ucguy4u
ucguy4u / Association.java
Last active December 8, 2020 04:53
eg: Association in Java
//eg: Association in Java
class A {
int x = 10;
}
class B {
A a = new A();
// new A()--> This is composition; part in java which is necessary.
// A a --> This is aggregation; part in java which is not necessary.
}
@ucguy4u
ucguy4u / index.html
Last active October 30, 2020 07:17
Loading the javascript file using blank html
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>An empty page</title>
<script src="script.js" defer></script>
</head>
<body>
</body>
@ucguy4u
ucguy4u / cloudSettings
Last active September 26, 2020 16:28
VS code settings
{"lastUpload":"2020-09-26T16:27:58.776Z","extensionVersion":"v3.4.3"}
/**
* @author uschauha
*/
public class Main {
public static void main(String[] args) {
int localValue = 5;
calculate(localValue);
System.out.println(localValue);
}
import java.util.ArrayList;
import java.util.List;
/**
* @author uschauha
*/
public class TestHeap {
public static void main(String[] args) {