Skip to content

Instantly share code, notes, and snippets.

@yurikilian
yurikilian / setup.sh
Last active August 22, 2023 11:04
Kubernetes - Setup node
#!/bin/sh
set -x
NEEDRESTART_MODE=a apt-get dist-upgrade --yes
apt update
apt -y full-upgrade
@yurikilian
yurikilian / prune.sh
Created June 30, 2021 11:16
prune local branches
#!/bin/bash
gitprune(){
set -x
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -D
}
@yurikilian
yurikilian / readme.md
Last active January 23, 2021 21:38
Example readme

Lambda: product

Lambda event handler

Must be allowed to send notifications to sns

It is not expected to save module into database

Definition


@yurikilian
yurikilian / .zshrc
Created March 19, 2020 14:14
ZSHRC
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/yurikilian/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
@yurikilian
yurikilian / profiles.js
Last active March 13, 2020 11:55
Windows terminal configuration
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
"tabWidthMode": "titleLength",
"profiles": [
{
@yurikilian
yurikilian / scrollBotom.jsx
Created January 31, 2020 14:56
Detect bottom of window scroll event
componentDidMount() {
this.props.fetch({ ...this.props.searchForm }, 0);
window.addEventListener('scroll', (event: any) => this.handleScroll(event));
}
componentWillUnmount() {
window.removeEventListener('scroll', this.handleScroll);
}
@yurikilian
yurikilian / JwtTokenConfiguration.java
Created July 10, 2019 14:26
Simple Oauth2 - Spboot2
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
@Configuration
public class JwtTokenConfiguration {
@yurikilian
yurikilian / ApiApplication.java
Last active March 17, 2023 04:38
Soft Delete Mongo Repository
import br.com.radharsomeluz.inventory.configuration.SoftDeletionMongoRepository;
import br.com.radharsomeluz.inventory.configuration.SoftDeletionRepositoryFactoryBean;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@SpringBootApplication
@EnableSwagger2
@EnableMongoRepositories(
### Keybase proof
I hereby claim:
* I am yurikilian on github.
* I am yurikilian (https://keybase.io/yurikilian) on keybase.
* I have a public key ASC5l5JOC_599Pjzp5uKfvVEUrpWtg0EyHRNaDO69eEuXwo
To claim this, I am signing this object:
@yurikilian
yurikilian / javascript.js
Last active October 28, 2017 13:37
Create React Native Class With Export Default
"React Native Component Class": {
"prefix": "rncc",
"body": [
"import React, { Component } from 'react';",
"import { View, StyleSheet } from 'react-native';\n\n",
"export default class ${1:ClassName} extends Component {",
"\tconstructor(props) {\n\t\tsuper(props);\n\t}",
"\trender() {",
"\t\treturn (",
"\t\t\t<View style={styles.container}>$0</View>",