Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / gist:602448
Created September 29, 2010 08:14
import org.restlet.Context;
import org.restlet.Request;
import org.restlet.Response;
import org.restlet.data.Reference;
import org.restlet.resource.Directory;
public class ClassLoaderDirectory extends Directory {
private ClassLoader _cl;
anonymous
anonymous / CompositeClassLoader.java
Created September 29, 2010 08:18
private static class CompositeClassLoader extends ClassLoader {
private Vector<ClassLoader> classLoaders = new Vector<ClassLoader>();
@Override
public URL getResource(String name) {
for (ClassLoader cl : classLoaders) {
URL resource = cl.getResource(name);
anonymous
anonymous / gist:602451
Created September 29, 2010 08:19
@Override
public Restlet createRoot() {
final Router router = new Router(getContext());
getConnectorService().getClientProtocols().add(Protocol.FILE);
getConnectorService().getClientProtocols().add(Protocol.CLAP);
LocalReference localReference = LocalReference.createClapReference(LocalReference.CLAP_THREAD, "/src/main/webapp/");
CompositeClassLoader customCL = new CompositeClassLoader();
@mhgrove
mhgrove / Example01_CreateOntology.java
Created December 6, 2010 20:16
Example programs using Ortiz, Pellet 3.0's new native API for OWL
package com.clarkparsia.pellet.examples;
import java.io.IOException;
import java.io.PrintWriter;
import com.clarkparsia.pellet.api.kb.Ontology;
import com.clarkparsia.pellet.api.kb.OntologyFactory;
import com.clarkparsia.pellet.api.kb.OntologySyntax;
import com.clarkparsia.pellet.api.term.TermFactory;
import com.clarkparsia.pellet.api.term.entity.NamedClass;
@bellbind
bellbind / refcontrol.uc.js
Created January 13, 2011 12:54
[firefox][userChrome][firefox4] referer control for userChrome.js
// ==UserScript==
// @name refcontrol.uc.js
// @include main
// @description Control referer sending by refControl addon settings
// @version 0.3
// @author bellbind
// @license MPL 1.1/GPL 2.0/LGPL 2.1
// @homepage https://gist.github.com/777814
// ==/UserScript==
/* Usage
@searls
searls / maven-git-flow.sh
Created June 24, 2011 00:25
My approximation of nvie's git flow when using maven-release-plugin to cut releases. - http://nvie.com/posts/a-successful-git-branching-model/
# How to perform a release with git & maven following the git flow conventions
# ----------------------------------------------------------------------------
# Finding the next version: you can see the next version by looking at the
# version element in "pom.xml" and lopping off "-SNAPSHOT". To illustrate,
# if the pom's version read "0.0.2-SNAPSHOT", the following instructions would
# perform the release for version "0.0.2" and increment the development version
# of each project to "0.0.3-SNAPSHOT".
# branch from develop to a new release branch
git checkout develop
@egonw
egonw / authors.sh
Last active September 26, 2015 18:18
Git commands I use to get the data for my "CDK 1.x.y" blog posts
git shortlog -s -n $v1..$v2
Store.create(function(store){
var graph = new store.rdf.createGraph();
store.rdf.setPrefix("earl", "http://www.w3.org/ns/earl#");
store.rdf.setDefaultPrefix("http://www.w3.org/ns/earl#")
store.rdf.setPrefix("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
graph.add(store.rdf.createTriple( store.rdf.createNamedNode("earl:test"),
@matsev
matsev / Delegate.java
Created December 3, 2011 20:02
Using Mock Obects in Spring Integration Tests
package com.jayway.example;
public interface Delegate {
String doSomething();
String doSomethingElse();
}
@lindenb
lindenb / FirstBases.java
Created March 4, 2012 14:50
Java Remote Method Invocation (RMI) for Bioinformatics
package sandbox.client;
import java.io.Serializable;
import sandbox.shared.SequenceAnalyzer;
public class FirstBases implements SequenceAnalyzer
{
private int count=0;
private transient StringBuilder sequence=null;
public FirstBases()
{