Skip to content

Instantly share code, notes, and snippets.

@ufuk
ufuk / intellij-vscode-theme.md
Created April 28, 2025 07:26
Best IntelliJ-like Themes for VS Code
@ufuk
ufuk / vscode-lombok-issue.md
Last active April 28, 2025 07:27
When lombok do not work in VS Code, check this out
@ufuk
ufuk / vscode-command-palette.txt
Last active April 26, 2025 11:52
Install "code" command to be able to type 'code .' in any folder to start editing files in that folder, or type 'code filename.txt' to start editing file
>Shell Command: Install code in PATH
@ufuk
ufuk / jcmd.sh
Created December 6, 2022 14:12
Display a Java process' system properties or flags (https://docs.oracle.com/en/java/javase/17/docs/specs/man/jcmd.html)
# list Java processes
jcmd -l
# list running JVM's system properties or flags (select a 'pid' from above command's result list)
jcmd pid VM.system_properties
jcmd pid VM.flags
kubectl rollout restart deployment name-of-my-deployment
@ufuk
ufuk / force-to-delete-pod.sh
Created April 22, 2022 12:55
How to force k8s to delete a pod via kubectl?
kubectl delete pods your-pod-name --grace-period=0 --force -n your-namespace-name
@ufuk
ufuk / git-empty-commit.sh
Created March 12, 2022 17:54
How to force git allowing to commit with empty content?
git commit --allow-empty -m "trigger pipeline with an empty commit"
@ufuk
ufuk / HtmlToTextUtils.java
Created October 6, 2021 13:13
Utility method to convert HTML text to plain text while preserving newlines (using jsoup as main dependency)
import org.apache.commons.lang3.StringUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.Node;
import org.jsoup.nodes.TextNode;
import java.util.List;
import java.util.stream.Collectors;
@ufuk
ufuk / XmlUtils.java
Last active November 12, 2021 13:36
Various XML utilities, such as unmarshal and consume XML input stream by target element name (and -optional- target element depth).
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.util.StreamReaderDelegate;
<properties>
<java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<jaxb.version>2.3.3</jaxb.version>
...
</properties>