Skip to content

Instantly share code, notes, and snippets.

Avatar

Yan Pujante ypujante

View GitHub Profile
@ypujante
ypujante / maven_staging_upload
Created Nov 21, 2010
This script uploads all your artifacts to maven (staging)
View maven_staging_upload
/*
* Copyright (c) 2010-2010 LinkedIn, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ypujante
ypujante / jroller401_to_jekyll.groovy
Created Mar 2, 2011
Parses the xml file produced by the template from jroller 4.0.1 and generate the posts for jekyll
View jroller401_to_jekyll.groovy
/**
* Parses the xml file produced by the template from jroller
*/
def xml = new XmlSlurper()
def posts = xml.parse(new File(args[0]))
posts.post.each { post ->
def date = post."@date".toString().split("T")[0]
def title = post."@title".toString()
@ypujante
ypujante / jroller401_to_disqus.groovy
Created Mar 2, 2011
generate the wpr xml formatted output for importing jroller 4.0.1 comments into disqus
View jroller401_to_disqus.groovy
import groovy.xml.MarkupBuilder
import java.text.SimpleDateFormat
/**
* Parses the xml file produced by the template from jroller and generates
* wxr xml file for importing in disqus
*/
sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssz")
sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
View MonitorMain.groovy
/*
* Copyright (c) 2011 Yan Pujante
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View MyPlugin.groovy
/*
* Copyright (c) 2011 Yan Pujante
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ypujante
ypujante / RefreshPlanPlugin.groovy
Created Nov 5, 2012
Example of a glu plugin to handle custom plan type
View RefreshPlanPlugin.groovy
/*
* Copyright (c) 2012 Yan Pujante
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ypujante
ypujante / CustomizePlanPlugin.groovy
Created Nov 14, 2012
Example of a glu plugin to customize a plan
View CustomizePlanPlugin.groovy
/*
* Copyright (c) 2012 Yan Pujante
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ypujante
ypujante / ExceptionJdk17Workaround.groovy
Last active Dec 15, 2015
The purpose of this class is to workaround an issue with groovy when running code compiled under jdk1.6 and running it under jdk1.7 (see forum thread: http://groovy.329449.n5.nabble.com/jdk7-and-IncompatibleClassChangeError-for-exception-class-td5714582.html)
View ExceptionJdk17Workaround.groovy
/*
* Copyright (c) 2013 Yan Pujante
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View GluConfigViaChild
// The glu script for the app (parent)
class AppGluScript
{
def onConfigChanged = { config ->
log.info("From AppGluScript.onConfigChanged => ${config}")
}
// required for parent/child relationship
def createChild = { args ->
@ypujante
ypujante / fix-el-capitan-slow-time-machine-speed.plist
Created Mar 6, 2016
Workaround to El Capitan Slow Time Machine speed
View fix-el-capitan-slow-time-machine-speed.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Copy under /Library/LaunchDaemons and issue sudo launchctl load /Library/LaunchDaemons/fix-el-capitan-slow-time-machine-speed.plist -->
<plist version="1.0">
<dict>
<key>Label</key>
<string>fix-el-capitan-slow-time-machine-speed</string>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/sysctl</string>