Skip to content

Instantly share code, notes, and snippets.

View skryvets's full-sized avatar
👋

Sergey Kryvets skryvets

👋
View GitHub Profile
#!/usr/bin/env kotlin
@file:Repository("https://repo.maven.apache.org/maven2/")
@file:DependsOn("com.squareup.okhttp3:okhttp:4.12.0")
import okhttp3.OkHttpClient
import okhttp3.Request
import org.w3c.dom.Document
import org.xml.sax.InputSource
import java.io.StringReader
@skryvets
skryvets / simple-http-request.main.kts
Created September 13, 2024 02:04
Simple kotlin script
#!/usr/bin/env kotlin
@file:Repository("https://repo.maven.apache.org/maven2/")
@file:DependsOn("com.squareup.okhttp3:okhttp:4.12.0")
import okhttp3.OkHttpClient
import okhttp3.Request
val client = OkHttpClient()
val request = Request.Builder().url("https://example.com").build();
@skryvets
skryvets / spring-boot-commands.sh
Last active October 17, 2023 19:43
Spring Boot Init commands
#Init spring webapp
spring init -d=lombok,web -type=gradle-project-kotlin -n=spring-boot-hello-world spring-boot-hello-world
#Shows available dependencies
spring init --list
#Init Spring Cloud Function
spring init -d=lombok,cloud-function -type=gradle-project-kotlin -n=spring-cloud-function-hello-world spring-cloud-function-hello-world
@skryvets
skryvets / Boostnote legacy installation.md
Created June 29, 2022 18:16
Boostnote legacy installation
rm -rf ~/.config/autostart/jetbrains-toolbox.desktop \
rm -rf ~/.local/share/JetBrains/Toolbox \
rm -rf ~/.local/share/applications/jetbrains-toolbox.desktop
@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
#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 / 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
@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 / 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