Skip to content

Instantly share code, notes, and snippets.

View ThomasWeinert's full-sized avatar
💻
programming

Thomas Weinert ThomasWeinert

💻
programming
View GitHub Profile
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<style type="text/css">
div.arrow {
width: 160px;
height: 200px;
background-color: black;
@ThomasWeinert
ThomasWeinert / css-arrow.html
Last active August 29, 2015 14:06
Arrow in CSS
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<style type="text/css">
div.arrow {
width: 100px;
height: 160px;
background-color: black;
@ThomasWeinert
ThomasWeinert / optimize.php
Created August 18, 2014 19:07
Optimize Namespaces
<?php
require_once(__DIR__.'/../../vendor/autoload.php');
$dom = new FluentDOM\Document();
$dom->preserveWhiteSpace = FALSE;
$dom->loadXml(
'<?xml version="1.0" encoding="UTF-8"?>
<atom:feed xmlns:atom="http://www.w3.org/2005/Atom">
<atom:title>Example Feed</atom:title>
<atom:entry>
@ThomasWeinert
ThomasWeinert / creator-functors.php
Last active August 29, 2015 14:05
Functor Magic
<?php
require('../../../vendor/autoload.php');
$dom = new FluentDOM\Document();
$dom->loadXml(
'<div>
<ul>
<li><a href="http://fluentdom.org">FluentDOM</a></li>
<li><a href="http://www.php.net">PHP</a></li>
</ul>
@ThomasWeinert
ThomasWeinert / jsonToXml.php
Last active August 29, 2015 14:05
FluentDOM Syntax Foo
<?php
require_once(dirname(__FILE__).'/../../vendor/autoload.php');
$json = <<<JSON
{
"firstName": "John",
"lastName": "Smith",
"age": 25,
"address": {
"streetAddress": "21 2nd Street",
<?php
require('../../vendor/autoload.php');
$_ = FluentDOM::create();
$_->registerNamespace('atom', 'http://www.w3.org/2005/Atom');
$_->formatOutput = TRUE;
echo $_(
'atom:feed',

Keybase proof

I hereby claim:

  • I am ThomasWeinert on github.
  • I am thomasweinert (https://keybase.io/thomasweinert) on keybase.
  • I have a public key whose fingerprint is 1BFB 7FB6 F47D 0300 6648 E53E 9AD2 AD10 EB2E 738F

To claim this, I am signing this object:

<?php
$xmlns = 'urn:foo';
$dom = new DOMDocument();
/*
On the root level the prefix is replaced by default
and the namespace for the attribute is lost
*/
<?php
// fetch the Firmata board depending on the configuration
$board = include(__DIR__.'/bootstrap.php');
// Carica Chip is used
use Carica\Chip as Chip;
// and http from Carica Io
use Carica\Io\Network\Http as Http;
$board
<?php
$data = array(
array('volume' => 67, 'edition' => 2),
array('volume' => 86, 'edition' => 1),
array('volume' => 85, 'edition' => 6),
array('volume' => 98, 'edition' => 2),
array('volume' => 86, 'edition' => 6),
array('volume' => 67, 'edition' => 7)
);