Skip to content

Instantly share code, notes, and snippets.

<routes xmlns="http://camel.apache.org/schema/spring" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring-2.13.2.xsd">
<route id="bar">
<from uri="timer://simple?fixedRate=true&amp;period=10s"/>
<to uri="bean:HelloWorld"></to>
<choice>
<when>
<mvel>request.body.number == &#39;123456789&#39;</mvel>
<log message="ok"></log>
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.apache.camel">
<dependencies>
<module name="javax.xml.bind.api"/>
<module name="javaee.api"/>
<module name="sun.jdk" />
</dependencies>
<resources>
<!--resource-root path="camel-cdi-2.13.1.jar"/-->
@elek
elek / gist:1330946
Created November 1, 2011 16:05
pin
PIN CODE=?
@elek
elek / gist:2006855
Created March 9, 2012 14:56
Daily WTF from javax.comm.jar
//from javax.comm.jar
private static String findPropFile()
{
String str1 = System.getProperty("java.class.path");
StreamTokenizer localStreamTokenizer = new StreamTokenizer(new StringReader(str1));
localStreamTokenizer.whitespaceChars(File.pathSeparatorChar, File.pathSeparatorChar);
localStreamTokenizer.wordChars(File.separatorChar, File.separatorChar);
localStreamTokenizer.ordinaryChar(46);
@elek
elek / gist:5623441
Created May 21, 2013 21:35
Workaround for idea module generation with google android plugin
project.ideaModule {
module.conventionMapping.sourceDirs = { project.sourceSets.main.allSource.srcDirs as LinkedHashSet }
module.conventionMapping.testSourceDirs = { project.sourceSets.test.allSource.srcDirs as LinkedHashSet }
def configurations = project.configurations
module.scopes = [
PROVIDED: [plus: [], minus: []],
COMPILE: [plus: [configurations.compile], minus: []],
RUNTIME: [plus: [], minus: []],
TEST: [plus: [configurations.testCompile], minus: []]
]

Upload Travis CI builds to S3

This will demonstrate how to upload build files from Travis CI to S3.

NOTE: Keys have been changed to protect the innocent.

Step 1: Create an S3 policy.

Create an S3 ACL policy, see s3_policy.json for an example.

@elek
elek / gist:d4cedeacff0fc981cab1
Last active January 10, 2016 10:44
httpie vs cuel
> curl "https://tilos.hu/feed/show/3-utas" !1780
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
<title>3. utas [Tilos Rádió podcast]</title>
<language>hu</language>
<updated>2016-01-10T11:43:09.284+01:00</updated>
<id>http://tilos.hu/show/3-utas</id>
<link href="https://tilos.hu/feed/show/3-utas" rel="self" type="application/atom+xml"/>
<itunes:author>Tilos Radio</itunes:author>
<itunes:explicit>clean</itunes:explicit>
"""Git branch comparator
Compares two git branches based on jira issue conventions. (eg. HADOOP-123). Prints out the commits which exist only on the first branch.
Usage:
compare.py --repo=REPO <source> <destination>
"""
from git import Repo
import re
#!/bin/bash
#echo "lang is set to de_CH in ~/mvnc.sh"
#LANG=de_CH
RESET="\e[0m"
BLACK="\e[0;30m"
RED="\e[0;31m"
GREEN="\e[0;32m"
YELLOW="\e[0;33m"
BLUE="\e[0;34m"
#!/usr/bin/env python
import sys, difflib
# The version of the file from the common ancestor of the two branches.
# This constitutes the 'base' version of the file.
ancestor = open(sys.argv[1],'r').readlines()
# The version of the file at the HEAD of the current branch.
# The result of the merge should be left in this file by overwriting it.
current = open(sys.argv[2],'r').readlines()