Skip to content

Instantly share code, notes, and snippets.

@robstryker
robstryker / gist:5964345
Created July 10, 2013 08:07
quickly get the GAV for a jar
Requires 2 files.
File 1: getGav.sh
#/bin/sh
#getGav.sh
TMPFILE=/home/rob/tmp/tmpfile.xml
EXTRACTGAV=/home/rob/scripts/extract-gav.xsl
FILE2=`ls $1 | awk '{ print "unzip -l " $0 " | grep pom.xml | cut -d M -f 2";}' | sh | awk '{ print "M" $0;}' `
unzip -q -c $1 $FILE2 > $TMPFILE && xsltproc $EXTRACTGAV $TMPFILE | head -n 4 | tail -n 3 && rm $TMPFILE
public static void test5() {
ArrayList<String> list = new ArrayList<String>();
for( int loop = 0; loop < 65536; loop ++ ) {
StringBuffer line = new StringBuffer();
boolean previousOperator = true; // plus
int bitmask = loop;
int total = 0;
String working = "";
for( int i = 0; i < 8; i++ ) {
working += (i+1);
#!/bin/sh
# make a new folder and put this file inside it.
# Then execute it.
#
# This script rewrites history for each of the four repositories,
# specifically, to make ALL commits of the repos believe they were
# always in a subfolder of the repository.
# Examples:
# - pom.xml from webtools.common repo is rewritten to believe it always
#!/bin/sh
# make a new folder and put this file inside it.
# Then execute it.
#
# This script rewrites history for each of the four repositories,
# specifically, to make ALL commits of the repos believe they were
# always in a subfolder of the repository.
# Examples:
# - pom.xml from webtools.common repo is rewritten to believe it always
#!/bin/sh
# make a new folder and put this file inside it.
# Then execute it.
#
# This script rewrites history for each of the four repositories,
# specifically, to make ALL commits of the repos believe they were
# always in a subfolder of the repository.
# Examples:
# - pom.xml from webtools.common repo is rewritten to believe it always
@robstryker
robstryker / gist:54cbdf76f9d3c325fd92477846add876
Created May 10, 2017 23:18
Simple master-only merge in wtp.common
# set our local pull command depending on git version
verlte() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}
verlt() {
[ "$1" = "$2" ] && return 1 || verlte $1 $2
}
GIT_VERSION=`git version | cut -f 3 -d " "`
verlte $GIT_VERSION 2.9.0 && ALLOW_PULL_FLAG=false || ALLOW_PULL_FLAG=true
@robstryker
robstryker / gist:2aeec38f3c70f674c606d33a51e7eb99
Created May 10, 2017 23:44
Better script for shallow (master-only) merge of wtp repos.
START_TIME=`date +%s`
# set our local pull command depending on git version
verlte() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}
verlt() {
[ "$1" = "$2" ] && return 1 || verlte $1 $2
@robstryker
robstryker / webtools.merge.servertools.sh
Last active October 5, 2017 20:01 — forked from nickboldt/webtools.merge.servertools.sh
merge webtools.servertools repos
#!/bin/bash
#
# merge servertools repos into a single repo
# based on https://paste.fedoraproject.org/paste/0tnkOZ4N0kP5AKLul2HLnA/raw
START_TIME=`date +%s`
# in case we have another alias for mv, like 'mv -i'
alias mv=mv
Tier 1: common / server
# Common still deps on javaee and server...
# we need a small api change in common's extension pt to use facet IRuntime
# instead of server IRuntime (which javaee will need to adjust to)
# and also need to move 1 plugin either from jeetools to common or from common to jeetools
common -> javaee, server
server -> common (OK)
#!/bin/bash
#
# move org.eclipse.jst.common.ui plugin into javaee
START_TIME=`date +%s`
# in case we have another alias for mv, like 'mv -i'
alias mv=mv