Skip to content

Instantly share code, notes, and snippets.

View itsmeritesh's full-sized avatar

Ritesh M Nayak itsmeritesh

View GitHub Profile
@itsmeritesh
itsmeritesh / SitemapController.groovy
Last active October 8, 2022 16:25
Grails controller that automatically generates a sitemapfor your website.
/**
* A Sitemap controller that automatically generates sitemap.xml for a grails website.
*
* Be sure to notice the controllerNamesToExclude and actionsToExclude lists
*
* References:
* http://stackoverflow.com/questions/3748125/xml-sitemap-in-grails
* http://stackoverflow.com/questions/2956294/reading-out-all-actions-in-a-grails-controller
*
*/
@itsmeritesh
itsmeritesh / sample.sh
Created September 23, 2013 10:13
A simple shell command to check if a git repository is up to date or not. You can use this to autodeploy simple websites, trigger workflows or notify people.
#!/bin/sh
if [ "`git --git-dir="/path/to/your/repo/.git" log --pretty=%H ...refs/heads/master^ | head -n 1`" = "`git --git-dir="/path/to/your/repo/.git" ls-remote origin -h refs/heads/master |cut -f1`" ]
then
echo "Repo up to date"
else
echo "Updates available .. pull changes and do magic here"
fi
@itsmeritesh
itsmeritesh / HttpServerTest.groovy
Created July 8, 2013 18:27
Unable to get this working. I am using Groovy 2.0.5 and JDK 1.7.10
import org.vertx.java.core.Vertx
import org.vertx.java.core.http.HttpServer
class HttpServerTest {
Vertx vertx
HttpServer httpServer
HttpServerTest() {
vertx = Vertx.newVertx()