Skip to content

Instantly share code, notes, and snippets.

View triaubaral's full-sized avatar

Aurélien Tricoire triaubaral

View GitHub Profile
@triaubaral
triaubaral / clean_code.md
Created November 1, 2018 17:43 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@triaubaral
triaubaral / md_to_rst.sh
Created January 4, 2018 18:47 — forked from hugorodgerbrown/md_to_rst.sh
Shell script for converting a batch of *.md files into *.rst using pandoc.
# This script was created to convert a directory full
# of markdown files into rst equivalents. It uses
# pandoc to do the conversion.
#
# 1. Install pandoc from http://johnmacfarlane.net/pandoc/
# 2. Copy this script into the directory containing the .md files
# 3. Ensure that the script has execute permissions
# 4. Run the script
#
# By default this will keep the original .md file
@triaubaral
triaubaral / gist:e5303bbe0f65de99f984e7593eac9482
Last active February 14, 2017 13:30
Iterate recursively over a directory with commons io
String dirPath = "path/to/dir/to/read";
String[] extensions = new String[]{"java"};
Iterator it = FileUtils.iterateFiles(new File(dirPath), extensions, true);
while(it.hasNext()){
File currentFile = (File) it.next();