Skip to content

Instantly share code, notes, and snippets.

View wjzijderveld's full-sized avatar

Willem-Jan Zijderveld wjzijderveld

View GitHub Profile
@wjzijderveld
wjzijderveld / vault-merge.sh
Last active February 20, 2019 10:16 — forked from benzado/vault-merge.sh
A shell script for merging encrypted Ansible vault files in a git repository
#!/bin/sh
set -euo pipefail
# vault-merge
# Benjamin Ragheb <ben@benzado.com>
# This shell script handles conflicts generated by attempts to merge encrypted
# Ansible Vault files. Run `git merge` as usual; when git warns of a merge
# conflict, run this command to attempt a merge on the unencrypted versions of
<?php
function xpathEscape($query,$default_delim = '"')
{
if((strpos($query,'\'') !== FALSE) ||
(strpos($query,'"') !== FALSE))
{
$quotechars = array('\'','"');
$parts = array();
$current_part = '';
@wjzijderveld
wjzijderveld / SoapClientTimeout.class.php
Created October 27, 2012 11:13 — forked from RobThree/SoapClientTimeout.class.php
PHP SoapClient with timeout
<?php
//Drop-in replacement for PHP's SoapClient class supporting connect and response/transfer timeout
//Usage: Exactly as PHP's SoapClient class, except that 3 new options are available:
// timeout The response/transfer timeout in milliseconds; 0 == default SoapClient / CURL timeout
// connecttimeout The connection timeout; 0 == default SoapClient / CURL timeout
// sslverifypeer FALSE to stop SoapClient from verifying the peer's certificate
class SoapClientTimeout extends SoapClient
{
private $timeout = 0;
private $connecttimeout = 0;