Skip to content

Instantly share code, notes, and snippets.

@sachin-handiekar
sachin-handiekar / gist:d997421f26418930ff1dea3fc78e814c
Created May 1, 2024 15:24
DefaultMethodSecurityExpressionHandlerTest
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
@sachin-handiekar
sachin-handiekar / gist:330f8d34d746da5194f86bba4abfbb4b
Created February 28, 2024 18:38
FAANG Mock Interview - interviewing.io - $100 Discount - https://iio.sh/r/EQCv
interviewing.io - Discount code ($100 off)- https://iio.sh/r/EQCv
Get $100 off at interviewing.io - https://iio.sh/r/EQCv
#FAANG
#MockInterview
#Google
#META
#Facebook
#Microsoft
@sachin-handiekar
sachin-handiekar / gist:589f2a110aa7e9f1a6b1d894826d6476
Created January 22, 2024 16:23
CodeCrafters - Free 1 week trial
https://app.codecrafters.io/r/calm-serval-779938
# Created by https://www.toptal.com/developers/gitignore/api/angular,node,intellij,java,maven
# Edit at https://www.toptal.com/developers/gitignore?templates=angular,node,intellij,java,maven
### Angular ###
## Angular ##
# compiled output
dist/
tmp/
app/**/*.js
app/**/*.js.map
User
Convert legacy Hibernate Criteria to Spring Boot JPA
ChatGPT
Hibernate Criteria is a way of building dynamic queries in Hibernate using Java code. JPA (Java Persistence API) is a specification that defines a set of Java interfaces for accessing relational databases. Spring Boot provides a JPA implementation, which makes it easier to work with relational databases in a Spring Boot application.
Here's an example of how to convert a Hibernate Criteria query to Spring Boot JPA:
Hibernate Criteria query:
java
@sachin-handiekar
sachin-handiekar / gist:d595621b39aa6bf4a29da37d3920c7f6
Created March 20, 2023 04:53
codecrafters.io - $400 discount code
codecrafters.io
https://app.codecrafters.io/join?via=sachin-handiekar
interviewing.io - Discount code ($100 off)- https://interviewing.io/?urc=jVrE
Get $100 off at interviewing.io - https://iio.sh/r/jVrE
@sachin-handiekar
sachin-handiekar / index.html
Created July 28, 2020 08:31
Basic HTML Email Template
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>[SUBJECT]</title>
<style type="text/css">
body {
padding-top: 0 !important;
padding-bottom: 0 !important;
padding-top: 0 !important;
@sachin-handiekar
sachin-handiekar / index.html
Created July 28, 2020 08:31
Basic HTML Email Template
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>[SUBJECT]</title>
<style type="text/css">
body {
padding-top: 0 !important;
padding-bottom: 0 !important;
padding-top: 0 !important;
Get $100 free credit - DigitalOcean
https://m.do.co/c/7f9140b7e9e1