Skip to content

Instantly share code, notes, and snippets.

View khill's full-sized avatar

Kevin Hill khill

  • West Chester, PA
View GitHub Profile
Processor Information:
Vendor: AuthenticAMD
CPU Family: 0x10
CPU Model: 0xa
CPU Stepping: 0x0
CPU Type: 0x0
Speed: 2700 Mhz
6 logical processors
6 physical processors
HyperThreading: Unsupported
@khill
khill / pommaker.py
Created October 13, 2015 00:11
Python script to download jar file info from Maven using SHA1 checksums and print Maven dependency records
#!/usr/bin/env python
'''
Script to generate the pom.xml dependency section for a bunch of jar files.
'''
import hashlib
import sys
import os
import json
@khill
khill / gist:d8ab80b5b3b154a2f1e2
Created June 27, 2015 16:00
Latest system info
Processor Information:
Vendor: AuthenticAMD
CPU Family: 0x10
CPU Model: 0xa
CPU Stepping: 0x0
CPU Type: 0x0
Speed: 2700 Mhz
6 logical processors
6 physical processors
HyperThreading: Unsupported
@khill
khill / sysinfo
Created June 23, 2015 14:11
System info from Steam
Processor Information:
Vendor: AuthenticAMD
CPU Family: 0x10
CPU Model: 0xa
CPU Stepping: 0x0
CPU Type: 0x0
Speed: 2700 Mhz
6 logical processors
6 physical processors
HyperThreading: Unsupported
@khill
khill / AlphaNumericSplittingFilter.java
Created July 26, 2013 02:10
Lucene TokenFilter subclass which splits text into tokens where numbers are next to letters.
import java.io.IOException;
import java.util.Arrays;
import java.util.LinkedList;
import org.apache.lucene.analysis.TokenFilter;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
@khill
khill / fizzbuzz.clj
Created March 18, 2013 20:16
Fizzbuzz in Clojure
(ns fizzbuzz)
(defn evenly-divisible [number divisor]
(zero? (mod number divisor))
)
(defn fizzbuzz [n]
(let [diviz (partial evenly-divisible n)]
(cond
(and (diviz 3) (diviz 5))
@khill
khill / jdbc_flush.sh
Created April 11, 2012 02:44
Shell script to query connection pool usage on JBoss and flush the JDBC pool if limit is exceeded
#!/bin/bash
#
# Script to check the number of connections in a JBoss connection pool via JMX and
# invoke flush() if the connection count is over a certain limit
#
JBOSS_HOME=/apps/jboss-eap-4.3/jboss-as
JBOSS_USER=admin
JBOSS_PASSWORD=secret1
@khill
khill / gist:2033689
Created March 14, 2012 03:00
Showing how to stream an image back from a Spring MVC Controller
@RequestMapping("/minuteGraph.htm")
public ResponseEntity <byte []> getUpdatesByMinuteGraph() {
HttpStatus responseCode = HttpStatus.OK;
byte [] image = new byte[0];
Map <String,Long> updatesByMinute = reportDao.loadUpdateCountsByMinute(15);
try {
image = this.getUpdateCountByMinuteGraph(updatesByMinute);
} catch (Exception e) {
responseCode = HttpStatus.INTERNAL_SERVER_ERROR;
}
@khill
khill / GraphController.java
Created March 14, 2012 02:48
Example of a Spring MVC Controller which Displays a Graph from JFreeChart
package org.khill.dashboard.controller;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.awt.Color;
@khill
khill / svnsearch.py
Created January 17, 2012 19:29
Simple library for building and searching an index from a subversion repository
import pysvn
import datetime
import os
from whoosh.index import create_in, open_dir
from whoosh.fields import *
from whoosh.qparser import QueryParser
schema = Schema(author=TEXT(stored=True),
message=TEXT(stored=True),
revision=KEYWORD(stored=True),