Skip to content

Instantly share code, notes, and snippets.

View dragansah's full-sized avatar

Dragan Sahpaski dragansah

View GitHub Profile
@hlship
hlship / Eliminate C3P0 System.err output
Created April 21, 2014 15:17
C3P0 tends to spit out some debugging information at startup. This offends me. I found a way to stop it.
;;; This is a hook for C3P0 to get rid of some garbage it logs to System.err on startup.
(let [err System/err]
(try
(System/setErr (PrintStream. (NullOutputStream.)))
(Class/forName "com.mchange.v2.c3p0.cfg.C3P0Config")
(finally
(System/setErr err))))
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@dmitrygusev
dmitrygusev / AppModule.java
Created May 12, 2013 07:25
Eager load Tapestry5 services on startup
public void contributeApplicationInitializer(OrderedConfiguration<ApplicationInitializerFilter> configuration,
@Symbol(TapestryEagerLoadInitializer.FORCE_EAGER_LOAD) boolean forceEagerLoad)
{
if (forceEagerLoad)
{
configuration.addInstance("EagerLoad", TapestryEagerLoadInitializer.class, "before:*");
}
}