Skip to content

Instantly share code, notes, and snippets.

View lhotari's full-sized avatar

Lari Hotari lhotari

View GitHub Profile
lhotari / pre-push
Created April 14, 2014 12:28
git pre-push hook script to prevent unintentional force pushs
View pre-push
IFS=' '
while read local_ref local_sha remote_ref remote_sha
if [ "$local_sha" = $z40 ]
View manifest.yml
- name: grailsorg-dev
memory: 2G
instances: 1
path: site-2.3.0.war
timeout: 120
JAVA_OPTS: -Dinitial.admin.password=verysecure -Dload.fixtures=true -Dfile.encoding=UTF-8 -Duser.language=en
15:13:23.848 INFO jd.cli.Main - Decompiling ./build/classes/test/org/codehaus/groovy/grails/web/servlet/mvc/Test3Controller.class
package org.codehaus.groovy.grails.web.servlet.mvc;
import grails.artefact.Artefact;
import grails.artefact.Enhanced;
import grails.web.Action;
import grails.web.controllers.ControllerMethod;
import groovy.lang.Closure;
import groovy.lang.GroovyObject;
import groovy.lang.MetaClass;
View delete_remote_issue_links.groovy
lhotari / gist:8d615fc20aa852247f35
Created December 9, 2014 12:27
View gist:8d615fc20aa852247f35
brew install caskroom/cask/brew-cask
brew cask install virtualbox
brew cask install vagrant
vagrant plugin install vagrant-cachier
vagrant plugin install vagrant-vbguest
vagrant plugin install vagrant-omnibus
View generate_plugins_markdown.groovy
* Script for generating Markdown for
@GrabResolver(name='grailsCore', root='', m2Compatible='true')
@Grab(group='org.slf4j', module='slf4j-nop', version='1.7.10')
@Grab(group='org.grails', module='grails-datastore-rest-client', version='4.0.0.M3')
def githubApiToken = System.getenv('GH_API_TOKEN')

Keybase proof

I hereby claim:

  • I am lhotari on github.
  • I am lhotari ( on keybase.
  • I have a public key whose fingerprint is 53A8 9613 1119 4A6B 0A44 97D9 E535 CAAF 8594 137E

To claim this, I am signing this object:

lhotari /
Created May 6, 2015 17:20
dumping threads in code on Java8+
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class DiagnosticCommandMBeanHelper {
public static String threadPrint() throws ReflectionException, MBeanException {
try {
lhotari / PatchedHibernatePluginSupport.groovy
Created September 28, 2012 19:59
GRAILS-9411 and GRAILS-9412 monkey patch for Grails 2.1.1
View PatchedHibernatePluginSupport.groovy
// src/groovy/grailspatch/PatchedHibernatePluginSupport.groovy
* Copyright 2004-2005 the original author or authors.
* 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
lhotari / JsonWorkaroundBootStrap.groovy
Created November 22, 2013 09:35
GRAILS-10823 workaround. add this file to grails-app/conf directory
View JsonWorkaroundBootStrap.groovy
import org.codehaus.groovy.grails.web.json.JSONObject
class JsonWorkaroundBootStrap {
def init = { servletContext ->
// activate workaround for GRAILS-10823
println("activating workaround for GRAILS-10823 - use this only for Grails 2.3.3")
org.springframework.util.ReflectionUtils.findField(JSONObject, "useStreamingJavascriptEncoder").with {
accessible = true
set(null, false)