Skip to content

Instantly share code, notes, and snippets.

Avatar

Ondrej Medek xmedeko

View GitHub Profile
@xmedeko
xmedeko / jdump.sh
Created May 22, 2013
jdump - JDK heap dump, wrapper around jmap (and jps)
View jdump.sh
#!/bin/sh
## Wrapper around jmap (and jps).
## Usage: PID file
if [[ "$#" -le 0 ]]; then
jps -ml
echo
echo "Usage: $(basename $0) PID file"
exit
@xmedeko
xmedeko / NativeSQLAliasedCriterion.java
Created Oct 16, 2012
Hibernate Native SQL Aliased Criterion
View NativeSQLAliasedCriterion.java
package org.xmedeko.hibernate;
import org.hibernate.Criteria;
import org.hibernate.EntityMode;
import org.hibernate.HibernateException;
import org.hibernate.criterion.CriteriaQuery;
import org.hibernate.criterion.Criterion;
import org.hibernate.engine.TypedValue;
import org.hibernate.type.Type;
import org.hibernate.util.ArrayHelper;
@xmedeko
xmedeko / NativeSQLOrder.java
Created Oct 16, 2012
Hibernate NativeSQLOrder
View NativeSQLOrder.java
package org.xmedeko.hibernate;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.criterion.CriteriaQuery;
import org.hibernate.criterion.Order;
import com.google.common.base.Strings;
/**
@xmedeko
xmedeko / adminlog.jsp
Created Aug 6, 2012 — forked from iamkristian/log4jAdmin.jsp
Change log4j log levels runtime from a jsp
View adminlog.jsp
<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%@ page import="org.apache.log4j.Level" %>
<%@ page import="org.apache.log4j.LogManager" %>
<%@ page import="org.apache.log4j.Logger" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Enumeration" %>
<%@ page import="java.util.Set" %>
<%@ page import="java.util.Arrays" %>
<%
/* This was originally suggested by Nelz on http://nelz.net/2008/04/08/log4j-runtime-configuration */
You can’t perform that action at this time.