Skip to content

Instantly share code, notes, and snippets.

View hyperized's full-sized avatar
🥑
Eating a sandwich

hyperized

🥑
Eating a sandwich
View GitHub Profile
---
# Run like: haproxy_drain_backend.yml --extra-vars="webserver=web01"
- hosts: haproxys
serial: 1
gather_facts: true
max_fail_percentage: 0
become: true
vars:
@hyperized
hyperized / xml_to_array.php
Created November 4, 2013 19:18
Handy XML to Array shortcut
<?php
// Source: http://stackoverflow.com/a/18707244
//convert the XML result into array
$array_data = json_decode(json_encode(simplexml_load_string($data)), true);
?>
@hyperized
hyperized / gist:6563252
Created September 14, 2013 16:13
A small PHP implementation of Kirupa.coms 3D 'engine'. It does the basic math and lacks commenting.
<?PHP
class ThreeD
{
static public function Transform2Dto3D(array $points, array $axis, $focalLength, $center_x, $center_y)
{
$pointarray = array();
$sx = sin($axis['x']);
$cx = cos($axis['x']);