Skip to content

Instantly share code, notes, and snippets.

@klauern
klauern / gist:77201
Created March 10, 2009 23:19 — forked from tony-landis/gist:31445
Simple HTTP POST/GET helper in Groovy fork
/**
* A Simple HTTP POST/GET Helper Class for Groovy
*
* @author Tony Landis
* @copyright 2007 Tony Landis
* @website http://www.tonylandis.com
* @license BSD License (http://www.opensource.org/licenses/bsd-license.php)
* @example h = new GroovyHTTP('http://www.google.com/search')
* h.setMethod('GET')
* h.setParam('q', 'groovy')
Interesting one I recently found:
Groovy Almanac - http://groovy-almanac.org/
Has a slew of good 5-liners or less for performing some common tasks.
I'm kind of disappointed there's no rating system, but it's a very clean page,
so I can't really whine too much about it.
@klauern
klauern / Some RegEx's.txt
Created January 30, 2009 21:12
A RegEx for searching JCAPS 5.1.x server.log files
Here is a regular expression listing:
Find comments in server.log files (JCAPS 5.1.3)
(\[#\|(.|\s)*(?#Insert which things you're looking for here. Be it BehavScor|Thing|Thin|)\|#])
The above regex (minus the (?#...) portion)
\[#\|(.|\s)*wefwefw(.|\s)*\|#]
The wefwefw portion is merely a marker for whatever you're really looking for. Say you want to look for your project's svcJcdwhatever, you would put that there.
In the case that you're looking for MULTIPLE things contained in a message log, you would pipe an OR inside of it like so:
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (2.1.0)
actionpack (2.1.0)
activerecord (2.1.0)
activerecord-jdbc-adapter (0.8.2)
activerecord-jdbcsqlite3-adapter (0.8.2)
activeresource (2.1.0)
activesupport (2.1.0)
#
# The GoF Abstract Factory pattern
# written by Matthieu Tanguay-Carel
#
# Factories behave in effect like singletons.
# Extra functionality can be tested for with "Object#respond_to? :extra"
# if needed (See GTKFactory).
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Assume we have the following program and external_file.rb library with defined function external_function.
require "external_file.rb"
a = external_function(1,2,3)
# Where should the loaded library file be located if program executes without errors? Assume that the
# current directory is not the same as the disk root and executed program's directory.
# Note: No command line options were used to invoke Ruby