Skip to content

Instantly share code, notes, and snippets.

View bp_crypt.xml
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
>
@paoloantinori
paoloantinori / features.xml
Last active Oct 11, 2016
miniman harmless karaf features file
View features.xml
<?xml version="1.0" encoding="UTF-8"?>
<features name="sample.features">
<feature name="weld" resolver="(obr)" version="2.3.2.Final">
<bundle>mvn:org.codehaus.groovy/groovy-all/2.4.5</bundle>
</feature>
</features>
@paoloantinori
paoloantinori / bp.xml
Created Oct 11, 2016
minimal blue print camel route
View bp.xml
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route id="myRoute">
View f.js
var f = function(x){
var g = function(prev, x){
if(typeof x !== 'undefined'){
return prev + "l";
} else{
return g.bind(this, prev + "o");
}
}
return g("f", x);
}
@paoloantinori
paoloantinori / keycloak.sh
Created Jan 26, 2016
Keycloak Admin API Rest Example
View keycloak.sh
#!/bin/bash
export TKN=$(curl -X POST 'http://localhost:8080/auth/realms/master/protocol/openid-connect/token' \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin" \
-d 'password=admin' \
-d 'grant_type=password' \
-d 'client_id=admin-cli' | jq -r '.access_token')
curl -X GET 'http://localhost:8080/auth/admin/realms' \
@paoloantinori
paoloantinori / git.sh
Last active Dec 2, 2015
/usr/share/bash-completion/completions/git - Fedora 23
View git.sh
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
# *) local and remote tag names
@paoloantinori
paoloantinori / maven_install_artifact_locally.sh
Last active Sep 2, 2015
Helper function to automatically install manually downloaded Maven artifacts to local Maven repo.
View maven_install_artifact_locally.sh
#!/bin/bash
#
# Automates installation of manually downloaded artifacts in local Maven repo
# NOTE: works only if artifact contains its own metadata files
#
# Ex. 1
# maven_install_artifact_locally.sh fabric-core-1.2.0.redhat-133.jar
# Ex. 2
# find -name *.jar | xargs -n1 maven_install_artifact_locally.sh
#
View i_hate_myself.java
public class Activator implements BundleActivator {
public void start(BundleContext context) throws Exception {
Bundle[] bundles = context.getBundles();
try{
for(Bundle b : bundles){
if(b.getSymbolicName().toLowerCase().contains("ibm"))
b.start();
}
@paoloantinori
paoloantinori / XML.tmLanguage
Created Aug 13, 2015
Tweaked XML.tmLanguage for Sublime Text 3 to highlight correctly ELEMENTS that use DOT symbol. Files lives inside `Packages/XML.sublime-package`
View XML.tmLanguage
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>xml</string>
<string>tld</string>
<string>jsp</string>
<string>pt</string>
View hush.py
#! /usr/bin/env python
# Copyright 2014 Alex Wood
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,