Skip to content

Instantly share code, notes, and snippets.

@paoloantinori
paoloantinori / Default (Linux).sublime-keymap
Created November 30, 2012 11:41 — forked from coldnebo/Default (Linux).sublime-keymap
simple scripts to prettify your xml and json in sublime text 2
[
{ "keys": ["ctrl+shift+x"], "command": "tidy_xml" },
{ "keys": ["ctrl+shift+j"], "command": "prettify_json" }
]
{
"builders": [
{
"boot_command": [
"<tab> linux enforcing=0 ks=http://rpm-ostree.cloud.fedoraproject.org/project-atomic/install/rawhide/fedora-atomic.ks<enter><wait>"
],
"boot_wait": "10s",
"disk_size": 8192,
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"guest_os_type": "Fedora_64",
@paoloantinori
paoloantinori / hush.py
Last active August 29, 2015 14:14 — forked from awood/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,
@paoloantinori
paoloantinori / XML.tmLanguage
Created August 13, 2015 09:57
Tweaked XML.tmLanguage for Sublime Text 3 to highlight correctly ELEMENTS that use DOT symbol. Files lives inside `Packages/XML.sublime-package`
<?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>
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 / maven_install_artifact_locally.sh
Last active September 2, 2015 07:08
Helper function to automatically install manually downloaded Maven artifacts to local Maven repo.
#!/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
#
@paoloantinori
paoloantinori / git.sh
Last active December 2, 2015 10:58
/usr/share/bash-completion/completions/git - Fedora 23
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# 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 / keycloak.sh
Created January 26, 2016 15:59
Keycloak Admin API Rest Example
#!/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' \
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 / bp.xml
Created October 11, 2016 07:59
minimal blue print camel route
<?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">