Skip to content

Instantly share code, notes, and snippets.

View alexschwartz's full-sized avatar

Alex Schwartz alexschwartz

View GitHub Profile
@alexschwartz
alexschwartz / gist:912787
Created April 10, 2011 22:14
Ask Jenkins via json using jquery
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Seitenr?nder - marginwidth, marginheight, topmargin, leftmargin</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
var baseUrl;
@alexschwartz
alexschwartz / gist:829676
Created February 16, 2011 16:35
GIT Knowhow - How to replace branches with tags?
## Given a git repo with at least one branch (for example "tags/A")
## which should be transformed into a tag
for t in `git branch -r | grep tags | perl -pi -e "s/origin\///"`; do
echo ============================ $t ;
REV=`git log -1 --pretty=%h origin/$t`;
COMMENT=`git log -1 --pretty=%s origin/$t`;
TAG=`echo $t | cut -d'/' -f2`;
echo $t .. $REV .. $COMMENT .. $TAG;
git tag -a $TAG -m "$COMMENT" $REV;
@alexschwartz
alexschwartz / pom.xml
Created November 16, 2010 23:06
Using a smart build number (Maven2 pom.xml)
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>${smartBuildNumber}</version>
....
<build>