Skip to content

Instantly share code, notes, and snippets.

@s-kocher
s-kocher / github_indentation_settings.md
Created November 4, 2019 09:29
Github indentation settings

timber/timber#2103

In code examples, I’ve advocated for using spaces instead of tabs because of inconsistencies that came up when viewing code examples in Markdown files in readme files on GitHub (#1955 (comment) or #1890 (comment)). The downside was that when copying code into your project, you’d have to change it to tabs again.

Recently, I stumbled over an interesting thread about this topic on Reddit: Nobody talks about the real reason to use Tabs over Spaces. The main point is that we should use tabs for accessibility reasons. The are different preferences for the indent size, especially for developer with visual impairment.

In this issue, I want to explore the best option to go forward. Apparently, when you [define the in

@s-kocher
s-kocher / IntelliJ Starter Kit.md
Last active May 21, 2022 23:59
IntelliJ Starter Kit

IntelliJ settings :

  • Version Control > Git > Enable staging area => CHECKED (Available since IntelliJ IDEA 2020.3 released 2020-12-01, long awaited feature since 2010-12 : IDEA-63391, still not the default behavior...)
    /!\ Agressive timeout probably in IDEA caused bad behaviors (staging diff editor compare against nothing) when git is slowed down, for example by an aggressive antivirus like described here with SEP, no problem with the historic git commit of IDEA not using git staging area
  • Editor > Code Editing - Quick Documentation - Show quick documentation on hover => CHECKED
  • Editor > Code Editing - Editor Tooltips - Tooltip delay => 200ms
  • Editor > General > Code Completion - Show the documentation popup => CHECKED + `50m
@s-kocher
s-kocher / MongoDBConfig.java
Last active February 3, 2022 10:34
Spring MongoConfig with client config + Custom converters
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.boot.autoconfigure.mongo.MongoClientSettingsBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.core.convert.MappingMongoConverter;
@Configuration(proxyBeanMethods = false)
class MongoConfig {
@s-kocher
s-kocher / pom.xml
Last active October 31, 2023 14:41
Sample pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>group.dummy-id</groupId>
<artifactId>artifact-dummy-id</artifactId>
<version>1.0.0-SNAPSHOT</version>
@s-kocher
s-kocher / backup_chrome_profile.cmd
Created January 3, 2023 14:49
Backup Chrome Profile
@echo off
SET SEVEN_ZIP_BIN=C:\Program Files\7-Zip\7z.exe
SET ARCHIVE_TYPE=7z
SET COMPRESSION_LEVEL=5
SET CHOME_VERSION=108.0.5359.125
SET DATE_STR=2022-11-29
SET EXCLUSION_PARAMS=-xr!Cache -xr!"Code Cache" -xr!GPUCache -xr!optimization_guide_hint_cache_store -xr!CacheStorage -xr!ScriptCache
SET CHROME_PROFILE_PATH=C:\Users\Sylvain\Chromium User Data
SET ARCHIVE_TARGET_FOLDERPATH=C:\Users\Sylvain
@s-kocher
s-kocher / winscp_putty.cmd
Created January 11, 2023 14:37
WinSCP Open PuTTY in current remote folder
%PUTTY_HOME%\putty.exe -t -m "%TEMP%\putty.txt" !`cmd.exe /c echo cd '!/' ; /bin/bash -login > "%TEMP%\putty.txt"`
@s-kocher
s-kocher / Kata_MowItNow.md
Last active February 20, 2023 20:59
Kata MowItNow

kata-MowItNow

La société MowItNow a décidé de développer une tondeuse à gazon automatique, destinée aux surfaces rectangulaires.

La tondeuse peut être programmée pour parcourir l'intégralité de la surface. La position de la tondeuse est représentée par une combinaison de coordonnées (x,y) et d'une lettre indiquant l'orientation selon la notation cardinale anglaise (N,E,W,S). La pelouse est divisée en grille pour simplifier la navigation.

Par exemple, la position de la tondeuse peut être « 0, 0, N », ce qui signifie qu'elle se situe dans le coin inférieur gauche de la pelouse, et orientée vers le Nord.