Skip to content

Instantly share code, notes, and snippets.

View mathieucarbou's full-sized avatar
🏠
Working from home

Mathieu Carbou mathieucarbou

🏠
Working from home
View GitHub Profile
// to put inside ~/.gradle/init.d/nojavadoc.gradle
allprojects {
afterEvaluate { project ->
if (project.rootDir.name in ['my-root-project-name']) {
tasks.withType(Javadoc) {
enabled = false
}
}
}
}
private static String md5(File file) throws IOException, NoSuchAlgorithmException {
return DatatypeConverter.printHexBinary(MessageDigest.getInstance("MD5").digest(Files.readAllBytes(file.toPath())));
}
@mathieucarbou
mathieucarbou / sublime-command-line.md
Created May 23, 2019 17:10 — forked from adrianorsouza/sublime-command-line.md
launch sublime text from the command line

Launch Sublime Text from the command line on OSX

Sublime Text includes a command line tool, subl, to work with files on the command line. This can be used to open files and projects in Sublime Text, as well working as an EDITOR for unix tools, such as git and subversion.

Requirements

  • Sublime text 2 or 3 installed in your system within Applications folder

Setup

@mathieucarbou
mathieucarbou / toolchains.groovy
Last active February 22, 2024 11:08
Maven toolchains.xml generator
#!/usr/bin/env groovy
import groovy.xml.MarkupBuilder
import java.nio.file.Files
import java.nio.file.Paths
def writer = new StringWriter()
def xml = new MarkupBuilder(writer)
xml.doubleQuotes = true
xml.mkp.xmlDeclaration([version: '1.0', encoding: 'UTF-8'])
@mathieucarbou
mathieucarbou / jdk_toolchain.xslt
Created February 12, 2020 16:02 — forked from chrisdennis/jdk_toolchain.xslt
Maven Toolchain XML Goodness
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/plist">
<toolchains>
<xsl:for-each select="array/dict">
<toolchain>
<type>jdk</type>
<provides>
<version>
# GIT
# Aliases in ~/.gitconfig
oldest-ancestor = !bash -c 'diff --old-line-format='' --new-line-format='' <(git rev-list --first-parent "${1:-master}") <(git rev-list --first-parent "${2:-HEAD}") | head -1' -
###########################################
# Fix authors after rebase:
#!/usr/bin/env bash
#
# Setup automatic sync from a Github upstream repository to a fork
# - a branch "actions" will be created (or re-used) to hold the Github action to run
# - sync is done each hour
# - branch 'actions' needs to be the default branch of your fork (=> settings)
# - the script is able to both create and update and rewrite the sync script if you modify this script file
#
# Author: Mathiue Carbou
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.LongAdder;
import java.util.stream.Stream;
import static java.lang.Thread.sleep;
import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
import static java.util.stream.Collectors.toList;
#!/usr/bin/env groovy
import groovy.xml.MarkupBuilder
import java.util.stream.Stream
import static java.util.stream.Collectors.toList
def candidates = Stream.of(
new File(System.getProperty("user.home"), ".sdkman/candidates/java"),
new File('/Library/Java/JavaVirtualMachines'))
@mathieucarbou
mathieucarbou / README.md
Last active March 14, 2023 17:45
Renault Zoé E-Tech R110 + Home Assistant + Charge auto avec le soleil

Renault Zoé E-Tech R110 + Home Assistant + Charge auto avec le soleil

Overview

image

image

Installation