Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View lhotari's full-sized avatar

Lari Hotari lhotari

View GitHub Profile
@lhotari
lhotari / DiagnosticCommandMBeanHelper.java
Created May 6, 2015 17:20
dumping threads in code on Java8+
import javax.management.DynamicMBean;
import javax.management.MBeanException;
import javax.management.ReflectionException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class DiagnosticCommandMBeanHelper {
public static String threadPrint() throws ReflectionException, MBeanException {
try {

Keybase proof

I hereby claim:

  • I am lhotari on github.
  • I am lhotari (https://keybase.io/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:

/*
* Script for generating Markdown for
* https://github.com/grails/grails-core/wiki/Travis-CI-status
*/
@GrabResolver(name='grailsCore', root='https://repo.grails.org/grails/core/', 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')
import grails.plugins.rest.client.RestBuilder
def githubApiToken = System.getenv('GH_API_TOKEN')
@lhotari
lhotari / gist:8d615fc20aa852247f35
Created December 9, 2014 12:27
install_vagrant_on_macosx.sh
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
@lhotari
lhotari / jira_spam_cleaner.groovy
Created July 29, 2014 04:04
Jira Groovy Script for cleaning comment spam from a certain user
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.comments.Comment
import com.atlassian.jira.issue.comments.CommentManager
import com.atlassian.jira.issue.search.SearchException
import com.atlassian.jira.bc.issue.search.SearchService
import com.atlassian.jira.web.bean.PagerFilter
import com.atlassian.jira.user.ApplicationUser
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;
---
applications:
- name: grailsorg-dev
memory: 2G
instances: 1
path: site-2.3.0.war
timeout: 120
buildpack: https://github.com/cloudfoundry/java-buildpack.git
env:
JAVA_OPTS: -Dinitial.admin.password=verysecure -Dload.fixtures=true -Dfile.encoding=UTF-8 -Duser.language=en -Duser.country=US
@lhotari
lhotari / pre-push
Created April 14, 2014 12:28
git pre-push hook script to prevent unintentional force pushs
#!/bin/bash
remote="$1"
url="$2"
z40=0000000000000000000000000000000000000000
IFS=' '
while read local_ref local_sha remote_ref remote_sha
do
if [ "$local_sha" = $z40 ]
@lhotari
lhotari / SyncSql.groovy
Last active December 31, 2015 02:29
extensions to groovy.sql.Sql for doing UPDATE and INSERT statements
/*
* Copyright 2013 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software