Skip to content

Instantly share code, notes, and snippets.

@dploeger
dploeger / gist:6898931
Last active December 25, 2015 01:59
Add xsd:dateTime-arguments for SOAP in Ladon:
In ladon/compat.py:
add to first lines:
from datetime import datetime
and in line #24:
type_to_xsd = {
int: 'long',
long: 'long',
@dploeger
dploeger / gist:f28275ce20f2e8c8922a
Created October 14, 2014 13:33
Calling Zimbra internal auth from a custom auth extension
String encodedPassword = acct.getAttr(Provisioning.A_userPassword);
if (acct instanceof LdapEntry) {
LdapProvisioning prov = (LdapProvisioning) acct.getProvisioning();
prov.zimbraLdapAuthenticate(acct, password, context);
return; // good password, RETURN
@dploeger
dploeger / local.properties
Created August 22, 2016 07:03
local.properties related to clustering
#
# Clustering
#
clustermode=true
cluster.id=0
cluster.maxid=1
cluster.broadcast.methods=jgroups
cluster.broadcast.method.jgroups=de.hybris.platform.cluster.jgroups.JGroupsBroadcastMethod
# Local cluster-IP (WARNING! Change on other node!)
cluster.broadcast.method.jgroups.tcp.bind_addr=172.16.1.5
@dploeger
dploeger / jgroups-tcp.xml
Created August 23, 2016 06:42
JGroups TCP configuration
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
channelSendOptions="8">
<Manager className="org.apache.catalina.ha.session.DeltaManager"
expireSessionsOnShutdown="false"
notifyListenersOnReplication="true"/>
<Channel className="org.apache.catalina.tribes.group.GroupChannel">
<Membership className="org.apache.catalina.tribes.membership.McastService"
address="228.0.0.4"
@dploeger
dploeger / bitshifter.patch
Created March 13, 2017 08:27
nibtools bitshifter.c patch for macOS
Index: bitshifter.c
===================================================================
--- bitshifter.c (revision 637)
+++ bitshifter.c (working copy)
@@ -439,13 +439,25 @@
// > 0 <= C <= 7 (see above)
// > *b = Next bit position to be copied from 'db' (1 <= B <= 8)
// > [ ((Q << C) & 0xff00) + new bits from db ] >> C
- **q = ( ( (__int32)((**q) >> (8-*c)) << 8) | (((__int32)db << (*b-1)) & 0xff) ) >> *c;
+ **q = ( ( (int32_t)((**q) >> (8-*c)) << 8) | (((int32_t)db << (*b-1)) & 0xff) ) >> *c;
@dploeger
dploeger / Touchbar System Stats.json
Created June 28, 2017 06:59
System Stats (CPU load, Free Memory, Free disk space) for Apple Touchbar using Bettertouchtool
{
"BTTPresetName" : "Touchbar System Stats",
"BTTPresetUUID" : "5BCAEC41-D306-4BB6-B172-F9EBB974D4D3",
"BTTPresetContent" : [
{
"BTTAppBundleIdentifier" : "BT.G",
"BTTAppName" : "Global",
"BTTAppSpecificSettings" : {
},
@dploeger
dploeger / UnirestAsPromise.ts
Created September 11, 2017 09:26
Unirest as Promise (Typescript)
import Bluebird = require('bluebird');
import {UnirestError} from './UnirestError';
/**
* A tool for converting a unirest object into a promise
* @param unirest The unirest instance
* @returns {Bluebird<any>}
*/
export function unirestAsPromise(unirest: any): Bluebird<any> {
return new Bluebird(
let Vaulted = require('vaulted');
let fs = require('fs');
let myVault = new Vaulted({
vault_host: 'localhost',
vault_port: 8200,
vault_ssl: false
});
myVault.prepare()
@dploeger
dploeger / Migration.md
Last active April 18, 2018 03:26
Migration Notes Godot 2 => Godot 3
package de.dieploegers.develop.idea.custommark.annotators
import com.intellij.lang.annotation.AnnotationHolder
import com.intellij.lang.annotation.Annotator
import com.intellij.lang.annotation.HighlightSeverity
import com.intellij.openapi.editor.markup.EffectType
import com.intellij.openapi.editor.markup.TextAttributes
import com.intellij.psi.PsiElement
import java.awt.Color