Skip to content

Instantly share code, notes, and snippets.

" Use black hole register for common delete/change keys
nnoremap x "_x
nnoremap dd "_dd
nnoremap D "_D
nnoremap d "_d
nnoremap c "_c
nnoremap C "_C
vnoremap d "_d
vnoremap x "_x
vnoremap c "_c
// styles/typography/typographies/paragraph.ts
export const paragraph = {
p: {
/* B2S
font-family: ${Montserrat};
font-weight: ${Medium};
font-size: 15px;
line-height: 24px;
letter-spacing: -0.01em;
*/
@pochka15
pochka15 / error.html
Created July 12, 2023 13:05
Built error.html page
<!DOCTYPE html>
<html lang="en">
<head data-build="">
<meta charset="UTF-8">
<title>Toolbox Enterprise</title>
<style>*{box-sizing:border-box}:root{--ring-action-link-color:#0080e5;--ring-borders-color:#c5d1db;--ring-button-primary-background-color:#1a98ff;--ring-link-color:#0f5b99;--ring-link-hover-color:#ff008c;--ring-main-color:#008eff;--ring-main-hover-components:#007ee5;--ring-secondary-color:#737577;--ring-tag-background-color:#e6ecf2;--ring-white-text-color:#fff}body,html{margin:0;padding:0;height:100%;font-family:system-ui,Arial,sans-serif;font-size:13px}h1{margin:0}p{margin-top:8px;margin-bottom:8px}header{display:flex;align-items:center;border-bottom:1px solid var(--ring-borders-color);padding:0 32px;height:64px}header>a{font-size:14px;text-decoration:none;color:var(--ring-link-color)}header>a:hover{text-decoration:underline}.centered-block{display:flex;justify-content:center;padding-top:96px}.message{margin-bottom:24px;color:var(--ring-secondary-color)}.content{margin-top:0;margin-bot
import React from 'react';
import {useForm} from 'react-hook-form';
import RegisteredInput from './registered-input';
type FormValues = {
name: string;
age: number;
};
function getFormValues(): FormValues {
{
"actions": [
{
"name": "publishTuple",
"payload": {
"tuple": [
1,
"Hello",
3.14
]
@pochka15
pochka15 / keybindings.json
Created May 19, 2021 10:08
some bindings
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+j",
"command": "cursorDown",
"when": "textInputFocus"
},
{
"key": "ctrl+k",
"command": "cursorUp",
@pochka15
pochka15 / scratch_1.kts
Last active May 1, 2021 14:20
cascade delete is not triggered
package pw.coins.room
import pw.coins.user.dtos.User
import javax.persistence.*
import au.com.console.jpaspecificationdsl.and
import au.com.console.jpaspecificationdsl.get
import au.com.console.jpaspecificationdsl.where
import io.kotest.matchers.shouldBe
import io.kotest.matchers.shouldNotBe
import org.junit.jupiter.api.Test
@pochka15
pochka15 / SecurityConfig.java
Last active April 2, 2021 08:36
spring security config + spring fox config
package com.pochka15.funfics.configs;
import com.pochka15.funfics.configs.filters.JwtRequestFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@pochka15
pochka15 / scratch_3.java
Created March 28, 2021 10:58
save by adding to the list
// It doesn't make inserts
@Transactional
public boolean saveByAddingToTheList(SavePostForm form, String authorName) {
final Optional<User> found = userRepository.findByName(authorName);
if (found.isPresent()) {
User user = found.get();
Post post = postFormToPostConverter.convert(form);
post.setAuthor(User.builder().id(found.get().getId()).build());
user.getPosts().add(post);
return true;

Store login date

  1. В SecurityConfig прописываем своего обработчика

    @Override
        protected void configure(HttpSecurity security) throws Exception {
            security.authorizeRequests()
                    .antMatchers("/register").permitAll()
                    .anyRequest().authenticated()