Skip to content

Instantly share code, notes, and snippets.

View ehartmann's full-sized avatar

Eric Hartmann ehartmann

  • Resilience
  • France
View GitHub Profile
@brettporter
brettporter / fix_maven_conflicts.rb
Created February 2, 2012 11:44
Automatically resolve conflicts in Maven POMs after a merge
#!/usr/bin/env ruby
require 'tempfile'
require 'optparse'
def parse_version(text)
if (text.match(/^\s*<version>\s*(.*?)\s*<\/version>\s*$/))
$1
else
nil
@max747
max747 / gist:1280444
Created October 12, 2011 06:30
java-diff-utils usage example
public class DiffTest {
@Test
public void parseDiffToSideBySideView() throws IOException {
List<String> lines = IOUtils.readLines(FileUtils.openInputStream(new File("httpd.conf.diff")));
Patch diff = DiffUtils.parseUnifiedDiff(lines);
DiffRowGenerator.Builder builder = new DiffRowGenerator.Builder();
builder.showInlineDiffs(false);
DiffRowGenerator generator = builder.build();
@bric3
bric3 / install_jdk5_post_lion.sh
Last active April 18, 2023 06:50
Automate the install of JDK 5 on Lion, Mountain Lion, Mavericks
# _______ _ _ _ _ _
# |__ __| | (_) (_) | | | |
# | | | |__ _ ___ ___ ___ _ __ _ _ __ | |_ _ __ ___ _____ _____ __| |
# | | | '_ \| / __| / __|/ __| '__| | '_ \| __| | '_ ` _ \ / _ \ \ / / _ \/ _` |
# | | | | | | \__ \ \__ \ (__| | | | |_) | |_ | | | | | | (_) \ V / __/ (_| |
# |_| |_| |_|_|___/ |___/\___|_| |_| .__/ \__| |_| |_| |_|\___/ \_/ \___|\__,_|
# | |
# |_|
#
# New home : https://github.com/bric3/osx-jdk5-installer
#!/usr/bin/env ruby
require 'ftools'
require 'fileutils'
require 'rubygems'
require 'RMagick'
include Magick
require 'open3'
def merge( files = [] )
@rlivsey
rlivsey / git-prune-tags.rb
Created March 26, 2010 15:47
Script to prune any tags which exist locally but not on the remote
#!/usr/bin/env ruby
require 'readline'
def prompt(prompt="> ")
input = nil
prompt += " " unless prompt =~ /\s$/
loop do
input = Readline.readline(prompt)
break if input.length > 0
end