Skip to content

Instantly share code, notes, and snippets.

View jstrachan's full-sized avatar

James Strachan jstrachan

View GitHub Profile
@jstrachan
jstrachan / settings.xml
Created September 18, 2015 09:06
hack to build against a sonatype release before its been sync'd...
...
<profile>
<id>sonatypeReleases</id>
<repositories>
<repository>
<id>releases.sonatype.org</id>
<name>SonaType Releases</name>
<url>https://oss.sonatype.org/content/repositories/releases</url>
</repository>
</repositories>
{
"apiVersion" : "v1",
"kind" : "ReplicationController",
"metadata" : {
"annotations" : { },
"labels" : {
"component" : "jenkins",
"provider" : "fabric8"
},
"name" : "jenkins"
@jstrachan
jstrachan / gist:f960917b4861f30a8a45
Last active August 29, 2015 14:02
names your iTerm2 tab after the current working directory, shows the path in the prompt and the git branch
# thanks to this gist for the iTerm2 tab naming stuff: https://gist.github.com/phette23/5270658
# can't remember where I cribbed the rest of this from!
# hacked it a bit to work on OS X
_bold=$(tput bold)
_normal=$(tput sgr0)
__vcs_dir() {
local vcs base_dir sub_dir ref
sub_dir() {
# put this in your .bash_profile to set the title to be the working directory
export PROMPT_COMMAND=''
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
from( "direct:test-no-ep" ).to( "drools://node/ksession1?action=insertBody" );
from( "direct:test-with-ep" ).to( "drools://node/ksession1?action=insertBody&entryPoint=ep1" );
from( "direct:test-message" ).to( "drools://node/ksession1?action=insertMessage" );
from( "direct:test-exchange" ).to( "drools://node/ksession1?action=insertExchange" );
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.2.0">
<ext:property-placeholder>
<ext:default-properties>
<ext:property name="hawtio.maven.index.dir" value=""/>
<ext:property name="hawtio.maven.index.repos">
<array>
<value>http://repo.fusesource.com/nexus/content/repositories/releases@id=fusesource.release.repo</value>
@jstrachan
jstrachan / gist:5161674
Last active December 14, 2015 22:49
example jars.xml
<jars>
<jar group="org.apache.camel" artifact="camel-core" version="2.10.0"/>
<jar group="org.apache.camel" artifact="camel-spring" version="2.10.0"/>
</jars>
@jstrachan
jstrachan / gist:5135696
Last active December 14, 2015 19:19 — forked from purplefox/gist:5135685
// Clearly this won't actually work since obs2 would need to be final but then you can't assign it inside the handler
MyEventBus eb = new MyEventBus();
Observable obs1 = eb.send("foo", "msg1");
Observable obs2 = obs1.mapMany(new Func1<String, String>() {
@Override
public void call(String str) {
System.out.println("Got result: " + str);
tell application "Google Chrome Canary"
activate
set the bounds of the first window to {0, 0, 1461, 874}
end tell
@jstrachan
jstrachan / gist:4721399
Created February 6, 2013 09:27
little example of a RX API to vertx event bus along with some user code using it
/**
* RX Facade for EventBus
*/
interface ReactiveEventBus {
/** Subscribe to events on the event bus */
<T> Obserable<T> subscribe(String address);
/** Make a request/reply */
<In,Out> Obserable<Message<Out>> request(String address, In inMessage);