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
#!/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
# 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:
@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>
@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 / 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

private static String md5(File file) throws IOException, NoSuchAlgorithmException {
return DatatypeConverter.printHexBinary(MessageDigest.getInstance("MD5").digest(Files.readAllBytes(file.toPath())));
}
// 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
}
}
}
}
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
/*
==============================================================================
SendKeys.cpp
This file is part of MIDI2LR. Copyright 2015-2017 by Rory Jaffe.
MIDI2LR is free software: you can redistribute it and/or modify it under the
@mathieucarbou
mathieucarbou / MacOS JDK installation.md
Last active April 28, 2022 20:12
MacOS JDK installation

After Sierra upgrade, all my JDK were removed. So here is how I reinstalled all of them with only brew commands, and manage them with jEnv.

First do all your mac updates (especially XCode), then:

Install Brew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
git config --global --add remote.upstream.fetch '+refs/pull/*/head:refs/remotes/upstream/pr/*'