Skip to content

Instantly share code, notes, and snippets.

View navichok26's full-sized avatar
💜

x5113nc3x navichok26

💜
View GitHub Profile
@navichok26
navichok26 / application.properties
Created January 12, 2020 08:39
spring boot config for postgreSQL
spring.datasource.url=jdbc:postgresql://localhost:5432/springbootdb
spring.datasource.username=postgres
spring.datasource.password=1234
spring.jpa.hibernate.ddl-auto=create
@navichok26
navichok26 / hibernate.cfg.xml
Created January 16, 2020 10:06
hibernate.cfg.xml for postgreSQL
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:5432/test_db</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">1234</property>
@navichok26
navichok26 / application.properties
Created February 8, 2020 12:09
Spring boot OAuth2 with google
security.oauth2.client.clientId=****
security.oauth2.client.clientSecret=****
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
@navichok26
navichok26 / .gitignore
Created February 8, 2020 13:55
file .gitignote for intellijIDEA Spring boot progect
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
@navichok26
navichok26 / WebSocketConfig.java
Last active May 31, 2020 17:49
WebSocketConfig
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/ws").withSockJS();
}
@Override
public void configureMessageBroker(MessageBrokerRegistry registry) {
registry.setApplicationDestinationPrefixes("/app");
@navichok26
navichok26 / ChatController.java
Created May 31, 2020 17:51
WebSocket Controller
@Controller
public class ChatController {
@MessageMapping("/chat.sendMessage")
@SendTo("/topic/public")
public ChatMessage sendMessage(@Payload ChatMessage chatMessage) {
return chatMessage;
}
}
@navichok26
navichok26 / WebSocketEventListener.java
Created May 31, 2020 18:09
WebSocketEventListener example
@Component
public class WebSocketEventListener {
private static final Logger logger = LoggerFactory.getLogger(WebSocketEventListener.class);
@Autowired
private SimpMessageSendingOperations messagingTemplate;
@EventListener
public void handleWebSocketConnectListener(SessionConnectedEvent event) {
@navichok26
navichok26 / .vimrc
Created June 3, 2020 06:36
My .vimrc configuration file
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}
Plug 'itchyny/lightline.vim'
Plug 'dracula/vim', { 'as': 'dracula' }
call plug#end()
syntax on
@navichok26
navichok26 / README.md
Created June 10, 2020 16:51
Как откатить\вернуть стандартный .bashrc файл
  • Делаем бекап старого .bashrc файла: mv .bashrc .bashrc.old

  • Откатываем .bashrc: cp /etc/skel/.bashrc ./

@navichok26
navichok26 / dracula_colors.xml
Created July 14, 2020 06:42
dracula colors for android
<color name="background">#282a36</color>
<color name="currentLine">#44475a</color>
<color name="selection">#44475a</color>
<color name="foreground">#f8f8f2</color>
<color name="comment">#6272a4</color>
<color name="cyan">#8be9fd</color>
<color name="green">#50fa7b</color>
<color name="orange">#ffb86c</color>
<color name="pink">#ff79c6</color>
<color name="purple">#bd93f9</color>