Skip to content

Instantly share code, notes, and snippets.

View MartinGross's full-sized avatar

Martin Gross MartinGross

View GitHub Profile
@MartinGross
MartinGross / improveUIGmail.user.js
Last active January 3, 2016 19:29
TamperMonkey user script for optimizing some aspects of the GMail user interface
// ==UserScript==
// @name GMail Webpage: Remove ad
// @namespace http://use.i.E.your.homepage/
// @version 0.1
// @description remove bottom ad
// @match https://mail.google.com/mail/*
// @copyright 2014+, You
// ==/UserScript==
// hiding bottom ads
@MartinGross
MartinGross / gist:3619937
Created September 4, 2012 10:42
Mockito example
//You can mock concrete classes, not only interfaces
LinkedList mockedList = mock(LinkedList.class);
//stubbing
when(mockedList.get(0)).thenReturn("first");
when(mockedList.get(1)).thenThrow(new RuntimeException());
//following prints "first"
System.out.println(mockedList.get(0));
" To set the toolbars off (icons on top of the screen)
set guioptions-=T
" Window settings
set lines=80 " Set window height
set columns=120 " Set window width 'co'
winpos 2000 60
colorscheme darkblue
set guifont=Bitstream_Vera_Sans_Mono:h9:cDEFAULT
@MartinGross
MartinGross / gist:520823
Created August 12, 2010 11:45
PerfMeasurement.java
/**
* Utility class for performance measurement and easy performance logging
* The measurement of durations is based on nanoseconds.
*
* @author Martin Gross
*/
public class PerfMeasurement {
private long startTime;
private long endTime;
@MartinGross
MartinGross / logfile_filter.rb
Created April 30, 2010 17:19
JMeter log file extractor for GnuPlot
class LogfileFilter
def initialize regex1, regex2, input_file_name, output_file_name
@read_file = File.new input_file_name, "r"
puts "Reading file #{input_file_name}"
@write_file = File.new output_file_name, "w"
puts "Writing to file #{output_file_name}"
@reg_ex_1 = Regexp.new regex1
# Set root category priority to INFO and its only appender to CONSOLE.
log4j.rootCategory=INFO, CONSOLE
#log4j.rootCategory=INFO, CONSOLE, LOGFILE
log4j.logger.org.apache=ERROR
log4j.logger.com=DEBUG
# Set the enterprise logger priority to FATAL
# log4j.logger.org.apache.axis2.enterprise=FATAL