Skip to content

Instantly share code, notes, and snippets.

View kkrakovych's full-sized avatar

Kostyantyn Krakovych kkrakovych

View GitHub Profile
@kkrakovych
kkrakovych / falsehoods-programming-time-list.md
Created March 31, 2024 09:49 — forked from timvisee/falsehoods-programming-time-list.md
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@kkrakovych
kkrakovych / springScheduledExecutors.java
Last active December 31, 2018 16:41
[Spring Scheduled Executors] #java #spring
// Scheduled thread pool creation.
@Bean(destroyMethod = "shutdown")
public ScheduledExecutorService taskExecutor() {
return Executors.newScheduledThreadPool(10);
}
// Wait for all threads to be terminated.
public void awaitTerminationAfterShutdown(ExecutorService threadPool) {
threadPool.shutdown();
try {