Skip to content

Instantly share code, notes, and snippets.

View kaustubhdeokar's full-sized avatar

Kaustubh Deokar kaustubhdeokar

View GitHub Profile
@kaustubhdeokar
kaustubhdeokar / launch.json
Last active November 18, 2024 13:11
Debug C++ in visual studio (vscode) - Linux
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch1",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/{filename}",
"args": [],
"stopAtEntry": false,
@kaustubhdeokar
kaustubhdeokar / controller.ApplicantController.java
Created March 1, 2024 06:12
Spring boot -Job-Applicant. Many to many model.
import com.example.demo.dto.ApplicantDto;
import com.example.demo.dto.ApplicantJobDto;
import com.example.demo.service.ApplicantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/applicant")
public class ApplicantController {
@kaustubhdeokar
kaustubhdeokar / gist:0f9e294fa509f9afd4e8bcffb7e085b3
Created November 16, 2023 18:25
application.properties for postgres database - spring boot project
server.port=8080
spring.datasource.url=jdbc:postgresql://localhost:5432/hrm
#spring.datasource.url=jdbc:postgresql://0.0.0.0:5432/hrm -> docker
spring.datasource.username=postgres
spring.datasource.password=postgres
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.ddl-auto=update
spring.jpa.defer-datasource-initialization=true
Setup superuser.
sudo -u postgres psql
alter user postgres password 'postgres';
Is service running on localhost ?
sudo systemctl status postgresql.service
Command to start postgres service locally.
sudo systemctl restart postgresql.service
scp <file> <username>@<destination ip address>:<path on destination>
@kaustubhdeokar
kaustubhdeokar / Worktree.txt
Last active September 20, 2021 18:20
Create worktree
1. Create worktree without branch checkout.
Done from inside repo for which you want to create a worktree.
git worktree add --no-checkout <path>
Ex: git worktree add --no-checkout /home/user/NewWorkTree.
2. Checking out while creating a new branch.
git worktree add --track -b <newbranchname> <path>
@kaustubhdeokar
kaustubhdeokar / chapter4.md
Last active June 5, 2021 07:20
Mongo DB: Querying Sub documents & Arrays

How many trips in the sample_training.trips collection started at stations that are to the west of the -74 longitude coordinate?

db.trips.find({ "start station location.coordinates": { "$lt": -74 }}).count()

How many inspections from the sample_training.inspections collection were conducted in the city of NEW YORK?

	db.inspections.find({ "address.city": "NEW YORK" }).count()