Skip to content

Instantly share code, notes, and snippets.

@hotestimator
hotestimator / nested_list
Created September 4, 2014 21:55
Nested tree list (recursive)
<?php
// http://stackoverflow.com/questions/8020947/how-to-obtain-a-nested-html-list-from-objects-array-recordset
function render_tree($tree)
{
echo '<ul>';
foreach ($tree as $node)
{
render_node($node);
}
echo '</ul>';
➜ dev vagrant provision
==> default: Running provisioner: shell...
default: Running: C:/cygwin64/tmp/vagrant-shell20140703-5844-wotlfe.sh
==> default: stdin: is not a tty
==> default: Ign http://us.archive.ubuntu.com precise InRelease
==> default: Ign http://us.archive.ubuntu.com precise-updates InRelease
==> default: Ign http://us.archive.ubuntu.com precise-backports InRelease
==> default: Hit http://us.archive.ubuntu.com precise Release.gpg
==> default: Hit http://us.archive.ubuntu.com precise-updates Release.gpg
==> default: Ign http://security.ubuntu.com precise-security InRelease
@hotestimator
hotestimator / phppre
Created May 15, 2013 18:46
quickly gives you a php print_r line where you can just type in the variable you want to print_r, on
<snippet>
<content><![CDATA[
echo '<pre>';
print_r(\$$1);
echo '</pre>';
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>phppre</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
@hotestimator
hotestimator / qbwc.php
Created April 24, 2012 23:13
Quickbooks Web Connector in PHP, raw.
<?php
require('includes/init.php');
/**
* QB_xml_request
*
* This class turns the posted xml file into a
* key/value pair object we can work with.
*
* @param xml object array
@hotestimator
hotestimator / qbwc.php
Created April 24, 2012 20:33
wsdl problem
<?php
// start server
$server = new SoapServer($wsdl);
$functions = $server->getFunctions();
$server->addFunction('Authenticate');
$server->handle();
/**
* 20120424.20:29:18 UTC : QBWebConnector.SOAPWebService.do_authenticate() : Authenticating to application 'QuickBooks Integrator', username = 'testuser'
20120424.20:29:18 UTC : QBWebConnector.SOAPWebService.do_authenticate() : *** Calling authenticate() with following parameters:<userName="testuser"><password=<MaskedForSecurity>
@hotestimator
hotestimator / boilerplate.html
Created March 7, 2012 03:56
HTML: Boilerplate
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>HTML5 boilerplate—all you really need…</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>