Skip to content

Instantly share code, notes, and snippets.

View drucoder's full-sized avatar
😋
lets code right now!

Andrew drucoder

😋
lets code right now!
View GitHub Profile
@drucoder
drucoder / application.properties
Created July 20, 2018 04:29
Spring Boot REST: добавляем oAuth2 авторизацию
security.oauth2.client.clientId=some-secret.apps.googleusercontent.com
security.oauth2.client.clientSecret=very-secret
security.oauth2.client.accessTokenUri=https://www.googleapis.com/oauth2/v4/token
security.oauth2.client.userAuthorizationUri=https://accounts.google.com/o/oauth2/v2/auth
security.oauth2.client.clientAuthenticationScheme=form
security.oauth2.client.scope=openid,email,profile
security.oauth2.resource.userInfoUri=https://www.googleapis.com/oauth2/v3/userinfo
security.oauth2.resource.preferTokenInfo=true
server.port=9000
@drucoder
drucoder / build.gradle
Last active July 31, 2023 13:58
Sarafan: Add db support
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.postgresql:postgresql')
compile('org.projectlombok:lombok')
compile('javax.xml.bind:jaxb-api')
compile('com.sun.xml.bind:jaxb-core')
compile('com.sun.xml.bind:jaxb-impl')
@drucoder
drucoder / pom.xml
Created June 19, 2018 04:55
Lombok: пишем меньше кода
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
@drucoder
drucoder / requests.js
Created June 18, 2018 05:48
Spring Boot REST: тестироем rest методы
// GET all
fetch('/message/').then(response => response.json().then(console.log))
// GET one
fetch('/message/2').then(response => response.json().then(console.log))
// POST add new one
fetch(
'/message',
{
@drucoder
drucoder / .bashrc
Created June 14, 2018 17:58
Code highlighting in console
alias ccat='pygmentize -g'
@drucoder
drucoder / config
Created May 25, 2018 15:41
Spring Boot. Быстрый старт: deploy на сервер
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://localhost:8080;
}
location /img/ {
alias /home/dru/uploads/;
}
@drucoder
drucoder / pom.xml
Created May 25, 2018 15:40
Spring Boot. Быстрый старт: deploy на сервер
<!-- JAXB -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0</version>
@drucoder
drucoder / application.properties
Created May 21, 2018 15:30
Spring Boot. Быстрый старт. Spring Session (+ reCaptcha)
recaptcha.secret=6LduQVoUAAAAACpkNtp9c5WWgyGENzIxZqF9SbZL
spring.session.jdbc.initialize-schema=always
spring.session.jdbc.table-name=SPRING_SESSION
@drucoder
drucoder / pom.xml
Created May 21, 2018 15:27
Spring Boot. Быстрый старт. Spring Session
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-jdbc</artifactId>
</dependency>
@drucoder
drucoder / application.properties
Created May 13, 2018 07:58
Spring Boot. Быстрый старт Flyway
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=create