Skip to content

Instantly share code, notes, and snippets.

View metlos's full-sized avatar

Lukas Krejci metlos

View GitHub Profile
@metlos
metlos / commit-msg
Created January 16, 2019 09:14
auto-sign-off - almost identical to the sample commit-msg hook from git, only adding a newline between the commit message and the sign-off
#!/usr/bin/sh
#
# An example hook script to check the commit log message.
# Called by "git commit" with one argument, the name of the file
# that has the commit message. The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit. The hook is allowed to edit the commit message file.
#
# To enable this hook, rename this file to "commit-msg".
cpath of entity - enCpath
cpath of element - elCpath
general element
---------------
RUD -> /path/{elCpath} (or /element/{elCpath}? because this isn't consistent with the rest of the REST are we asking for the path of a {elCpath} ?)
relationships
-------------
CRUD -> /relationships/{enCpath}
/*-------------------------------------------------------------------------
*
* Copyright (c) 2004-2014, PostgreSQL Global Development Group
*
*
*-------------------------------------------------------------------------
*/
package org.postgresql.test.leaks;
import java.lang.ref.WeakReference;
@metlos
metlos / aliases
Last active October 12, 2022 14:47
git aliases for pull requests and other useful stuff
[alias]
tracking-branch = !git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD)
current-branch = !git rev-parse --abbrev-ref HEAD
#last commit
last = log -1
#assumes the upstream repo is called origin
Example:
<bundle-target>
<destination-base-dir name="Deploy Directory" description="The deployment directory for a standalone server">
<value-context>measurementTrait</value-context>
<value-name>deployDir</value-name>
</destination-base-dir>
<special-destination name="Patch Installer" description="Accepts JBoss AS patches and installs them to a standalone server" bundle-type="JBoss AS Patch Bundle">
<value-reference reference-name="host" context="pluginConfiguration" name="hostname"/>
<value-reference context="pluginConfiguration" name="port"/>
<value-reference context="pluginConfiguration" name="user"/>
@metlos
metlos / example.py
Created July 12, 2012 19:35
Importing script from RHQ server
import sys
sys.path.append("__rhq__:rhq://repositories/my_repo/")
import my_script as foo
...
@metlos
metlos / PythonScriptEngineInitializer.java
Created July 12, 2012 19:19
PythonScriptEngineInitializer
public class PythonScriptEngineInitializer implements ScriptEngineInitializer {
private static final Log LOG = LogFactory.getLog(PythonScriptEngineInitializer.class);
static {
Properties props = new Properties();
props.put("python.packages.paths", "java.class.path,sun.boot.class.path");
props.put("python.packages.directories", "java.ext.dirs");
props.put("python.cachedir.skip", false);
PythonInterpreter.initialize(System.getProperties(), props, null);
@metlos
metlos / scriptEngineProvider.java
Created July 12, 2012 19:15
ScriptEngineProvider
public class PythonScriptEngineProvider implements ScriptEngineProvider {
@Override
public String getSupportedLanguage() {
return "python";
}
@Override
public ScriptEngineInitializer getInitializer() {
return new PythonScriptEngineInitializer();