Skip to content

Instantly share code, notes, and snippets.

@katta
katta / Jenkins_Growl_Notifier.rb
Created July 10, 2012 15:05
Growl notifier for jenkins
#!/usr/bin/ruby
require 'rubygems'
require 'json'
require 'net/http'
require 'uri'
require 'date'
$ciBaseUrl = 'http://ci.motechproject.org' #URL of your jenkins CI
$jobs = ['Ananya-Kilkari','Ananya-Reports','Ananya-Kilkari-Smoke'] # add all the jobs to be monitored in this list
@katta
katta / CouchDB_Example_BlogPostIntegrationTest.java
Created July 6, 2011 12:52
CouchDB_Example_BlogPostIntegrationTest
public class BlogPostIntegrationTest extends SpringIntegrationTest {
@Autowired
private BlogPosts blogPosts;
@Test
public void shouldPersistWithChildren() {
BlogPost blogPost = new BlogPost();
blogPost.setName("the blog");
blogPosts.add(blogPost);
@katta
katta / CouchDB_Example_BlogPostWithComment.java
Created July 6, 2011 12:51
CouchDB_Example_BlogPostWithComment
@TypeDiscriminator("doc.documentType == 'BlogPost'")
public class BlogPost extends CouchEntity {
private String name;
@DocumentReferences(backReference="blogPostId", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
private Set<Comment> comments = new HashSet<Comment>();
/* getters and setters */
public void addComment(Comment comment) {
comment.setBlogPostId(this.getId());
@katta
katta / CouchDB_Example_Comment.java
Created July 6, 2011 12:49
CouchDB_Example_Comment
@TypeDiscriminator("doc.documentType == 'Comment'")
public class Comment extends CouchEntity {
private String blogPostId;
private String notes;
/* getters and setters */
}
@katta
katta / CouchDB_Example_BlogPost.java
Created July 6, 2011 12:33
CouchDB_Example_BlogPost
@TypeDiscriminator("doc.documentType == 'BlogPost'")
public class BlogPost extends CouchEntity {
private String name;
@DocumentReferences(backReference="blogPostId", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
private Set<Comment> comments = new HashSet<Comment>();
/* getters and setters */
}
@katta
katta / gitdiff-svnpatch.sh
Created June 16, 2011 08:10
Converts git diff to svn patch format
git diff --no-prefix | sed -e "s/^diff --git [^[:space:]]*/Index:/" -e "s/^index.*/===================================================================/" --ignore-space-at-eol > changes.patch
@katta
katta / mvncolor.sh
Created June 15, 2011 18:50
Script to add colors to maven output
#!/usr/bin/env bash
# Formatting constants
export BOLD=`tput bold`
export UNDERLINE_ON=`tput smul`
export UNDERLINE_OFF=`tput rmul`
export TEXT_BLACK=`tput setaf 0`
export TEXT_RED=`tput setaf 1`
export TEXT_GREEN=`tput setaf 2`
export TEXT_YELLOW=`tput setaf 3`