Skip to content

Instantly share code, notes, and snippets.

View skryvets's full-sized avatar
👋

Sergey Kryvets skryvets

👋
View GitHub Profile
@skryvets
skryvets / webpack.config.js
Created March 23, 2018 18:31
Webpack configuration file
var webpack = require('webpack');
var path = require('path');
var fs = require('fs');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var SvgStore = require('webpack-svgstore-plugin');
var LiveReloadPlugin = require('webpack-livereload-plugin');
var inProduction = process.env.NODE_ENV === 'production';
@Configuration
@EnableWebSecurity
public class WebSecurity extends WebSecurityConfigurerAdapter {
public WebSecurity() {}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.cors().and().csrf().disable().authorizeRequests()
@skryvets
skryvets / Gradle dependencies local path MacOS
Last active June 13, 2020 16:20
Location where Gradle stores dependencies on your local file system when is pulled from MavenCentral or some other remote repository
~/.gradle/caches/modules-2/files-2.1
@skryvets
skryvets / restart-touchbar.sh
Created December 23, 2019 16:07
Restart Mac's touchbar
pkill "Touch Bar agent";
killall "ControlStrip";
#or the same with sudo
sudo pkill "Touch Bar agent";
sudo killall "ControlStrip";
@skryvets
skryvets / application.properties
Created April 8, 2021 15:20
Enable logging and statistics of JPA queries
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.generate_statistics=true
@skryvets
skryvets / Scratch.java
Last active April 8, 2021 21:48
Stream filter and sort example
/*
In this scenario we create twenty random cars (random model and year).
An expected result is to only get Toyota and sort by year, newest first.
*/
class Scratch {
public static void main(String[] args) {
List<Car> cars = CarFactory.createTwentyRandomCars();
System.out.println("Initial Cars list: " + cars.toString());
@skryvets
skryvets / check-latest-lts-node-version.sh
Created October 4, 2021 22:36
check-latest-lts-node-version.sh
#!/usr/bin/env bash
. ~/.nvm/nvm.sh
cr=`echo $'\n.'`
cr=${cr%.}
currentNodeVersion=$(node -v)
echo Your NodeJS version is $currentNodeVersion
#Create a file
sudo touch /usr/local/bin/idea
#bash script:
#!/usr/bin/env bash
snap run intellij-idea-ultimate $1 /dev/null 2&1 &
@skryvets
skryvets / python-cheatsheet.md
Last active March 30, 2022 18:34
Python Cheat Sheet

pyenv

pyenv versions # show installed versions
pyenv install --list | grep " 3\.[6]" # show available versions for prefix