Skip to content

Instantly share code, notes, and snippets.

View ypujante's full-sized avatar

Yan Pujante ypujante

View GitHub Profile
@ypujante
ypujante / maven_staging_upload
Created November 21, 2010 18:18
This script uploads all your artifacts to maven (staging)
/*
* 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 March 2, 2011 16:52
Parses the xml file produced by the template from jroller 4.0.1 and generate the posts for jekyll
/**
* 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 March 2, 2011 17:22
generate the wpr xml formatted output for importing jroller 4.0.1 comments into disqus
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")
/*
* 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 / MyPlugin.groovy
Created December 12, 2011 18:33
RFC glu plugin
/*
* 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 November 5, 2012 19:10
Example of a glu plugin to handle custom plan type
/*
* 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 November 14, 2012 18:53
Example of a glu plugin to customize a plan
/*
* 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 December 15, 2015 15:28
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)
/*
* 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
// 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 March 6, 2016 18:41
Workaround to El Capitan Slow Time Machine speed
<?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>