This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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). | |
# | |
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'uri' | |
# /api/v1/:format/new | |
# /api/v1/:format/gists/:user | |
# /api/v1/:format/:gist_id | |
res = Net::HTTP.post_form(URI.parse('http://gist.github.com/api/v1/xml/new'), | |
{ 'files[file1.ab]' => 'CONTNETS', | |
'files[file2.ab]' => 'contents' }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Method to detect whether we are running from an elevated command-prompt | |
# under Vista/Win7 or as part of the local Administrators group in WinXP. | |
# | |
def elevated? | |
whoami = `whoami /groups` rescue nil | |
if whoami =~ /S-1-16-12288/ | |
true | |
else | |
admin = `net localgroup administrators | find "%USERNAME%"` rescue "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra-caching' | |
run SinatraCache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Running com.me.RequestTest | |
Aug 10, 2011 4:16:24 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromWSDL | |
INFO: Creating Service {http://service.something.net/xml}QueryService from WSDL: file://C:/mydocs/Work/project/my-service.wsdl | |
Aug 10, 2011 4:16:50 PM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging | |
WARNING: Interceptor for {http://service.something.net/xml}QueryService#{http://service.something.net/xml}QueryRequest has thrown exception, unwinding now | |
org.apache.cxf.binding.soap.SoapFault: "http://service.something.net/xml", the namespace on the "QueryResponse" element, is not a valid SOAP version. | |
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.readVersion(ReadHeadersInterceptor.java:115) | |
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:141) | |
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60) | |
at org.a |
OlderNewer