Skip to content

Instantly share code, notes, and snippets.

@andizzle
andizzle / gist:1798071
Created February 11, 2012 09:08
WooCommerce product dimensions/weight units normaliser
<?php
/**
* For WooCommerce 1.4.2 and above
* Dimensions/weight Units Normaliser
* Author Andy Zhang
* Company: Hypnotic Zoo
* Company Url: hypnoticzoo.com
*/
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Body>
<CreateAccessCodeResponse xmlns="https://uk.ewaypayments.com/hotpotato">
<CreateAccessCodeResult>
<AccessCode>nvt0mwZXN9aU43rsIRPlve3aNziYqA7VHLT3RurzaEvm</AccessCode>
<Customer>
<Reference>Test123</Reference>
<Title>Mr.</Title>
<FirstName>John</FirstName>
@andizzle
andizzle / soap-xml.php
Created August 16, 2012 02:40
SOAP XML parser
<?php
class SOAP_parser {
/**
* Convert an XML (SOAP) document to a multi dimensional array
* Pass in an XML document (or SimpleXMLElement object) and this recrusively loops through and builds a representative array
*
* @param string $xml - XML document - can optionally be a SimpleXMLElement object
* @return array ARRAY
*/
function toArray($xml) {
import os
import time
import subprocess
def create_commits(path):
os.chdir(path)
for i in xrange(1, 10):
start = time.clock()
subprocess.call('dd if=/dev/urandom of=testfile_1MB bs=1024 count=1', shell=True)
subprocess.call('cat testfile_1MB >> testfile_500MB', shell=True)
{
"id": "147",
"profile_id": "14752994",
"web_property_id": "UA-7312385-1",
"name": "solargain.com.au",
"buffer_profile_facebook_id": "",
"buffer_profile_twitter_id": "",
"buffer_profile_linkedin_id": "",
"buffer_profile_appnet_id": "",
;;; color-theme-molokai.el --- Molokai color theme by Lloyd
;;
;; Author: Adam Lloyd <adam@alloy-d.net>
;; URL: https://github.com/alloy-d/color-theme-molokai
;; Version: 0.1
;; GitCommit: 9a092b3768e276f9c82d3370b239fb1c589ac0c1
;; Keywords: colortheme molokai theme syntax highlighting
;;
;; Note: Based on the molokai theme for vim by Tomas Restrepo, which
;; is in turn based on the monokai theme for textmate by Wimer
# basic settings
if-shell 'test -z "$POWERLINE_COMMAND"' 'if-shell "which powerline-client" "set-environment -g POWERLINE_COMMAND powerline-client" "set-environment -g POWERLINE_COMMAND powerline"'
set -g default-terminal "screen-256color"
setw -g xterm-keys on
set -g base-index 0
set -s escape-time 0
setw -g mode-mouse off
# bindings
# first rebind prefic
(require 'package)
(add-to-list 'package-archives
'("marmalade" .
"http://marmalade-repo.org/packages/") t)
(add-to-list 'package-archives
'("melpa" .
"http://melpa.milkbox.net/packages/") t)
(package-initialize)
# basic settings
if-shell 'test -z "$POWERLINE_COMMAND"' 'if-shell "which powerline-client" "set-environment -g POWERLINE_COMMAND powerline-client" "set-environment -g POWERLINE_COMMAND powerline"'
set -g default-terminal "screen-256color"
setw -g xterm-keys on
set -g base-index 0
set -s escape-time 0
setw -g mode-mouse off
# bindings
# first rebind prefic
<VirtualHost *:80>
ProxyPreserveHost On
ProxyRequests Off
ServerName jira.emoteworkstation.com
ServerAlias jira.emoteworkstation.com
ProxyPass / http://jira.emoteworkstation.com:8080/
ProxyPassReverse / http://jira.emoteworkstation.com:8080/
</VirtualHost>