Skip to content

Instantly share code, notes, and snippets.

View mbroadst's full-sized avatar

Matt Broadstone mbroadst

View GitHub Profile
#include <QtCore/QtCore>
#include <QtCore/QCoreApplication>
#include <QtCore/QByteArray>
#include <QtCore/QDebug>
#include <QtCore/QLatin1Char>
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
#ifndef RAW_DATA_H
#define RAW_DATA_H
static const char msft_sample_encoded_data[] =
{
0xc7, 0xcc, 0x3e, 0x0b, 0x00, 0x00, 0x01, 0x01, 0xc2, 0xca, 0x00, 0x00, 0x51, 0x50, 0x01, 0x40,
0x01, 0x00, 0x23, 0x0b, 0x00, 0x00, 0x66, 0x66, 0x77, 0x88, 0x98, 0xc3, 0xca, 0x23, 0x0b, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xae, 0x03, 0xcf, 0x03, 0x93, 0x03, 0xc0, 0x01,
0x01, 0x15, 0x48, 0x99, 0xc7, 0x41, 0xa1, 0x12, 0x68, 0x11, 0xdc, 0x22, 0x29, 0x74, 0xef, 0xfd,
0x20, 0x92, 0xe0, 0x4e, 0xa8, 0x69, 0x3b, 0xfd, 0x41, 0x83, 0xbf, 0x28, 0x53, 0x0c, 0x1f, 0xe2,
// TEST OBJECT CLASS
class TestObject : public QObject
{
Q_OBJECT
Q_PROPERTY(QString testText READ testText WRITE setTestText)
public:
TestObject(QObject *parent = 0)
: m_testText("testing") {}
~TestObject() {}
import QtQuick 1.0
Item {
property string key // settings.network.test
property QtObject dataSource // testData
property Item uiElement // nameField
property string uiElementProperty // "text"
property Component uiElementValue // namedField.text
// replace this
Binding { target: testData; property: "settings.network.test"; value: nameField.text }
Binding { target: nameField; property: "text"; value: testData["settings.network.test"] }
// with this
TwoWayBinding { objectOne: testData; targetOne: "settings.network.test";
objectTwo: nameField; targetTwo: "text" }
{"object with 1 member":["array with 1 element"]}
{"foo": "bar"}
{"classification":{"relevancyScore":1000,"searchUrl":{"value":"http://www.bizrate.com/iphone-cases/index__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"}},"products":{"priceSet":{"minPrice":{"value":"$0.01","integral":1},"maxPrice":{"value":"$4,833.99","integral":483399}},"product":[{"type":"PRODUCT","title":"Silicone case for iPhone 3G/ 3GS","description":"Elite Horizontal Leather Pouch for Apple iPhone 3G/3Gs - Premium quality horizontal case for your Apple iPhone 3G/3Gs. This pouch is ideal for the style conscious on the go. This great looking case is made from high-quality leather with classic black...","manufacturer":"Apple","url":{"value":"http://www.bizrate.com/silicone-case-for-iphone-3g-3gs--pid1968262863/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=1968262863
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns:tns="urn:RpcExample" xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:RpcExample="urn:RpcExample" xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:MIME="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:DIME="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/" xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" name="urn:RpcExample" targetNamespace="urn:RpcExample">
<types>
<schema xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:RpcExample="urn:RpcExample" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:RpcExample" elementFormDefault="unqualified" attributeFormDef
#include <nan.h>
#ifndef _WIN32
#include <unistd.h>
#define Sleep(x) usleep((x)*1000)
#endif
using namespace v8;
class AsyncEmitter : public node::ObjectWrap
Q_GLOBAL_STATIC(QVariantMap, settingsCache);
AgentSettings::AgentSettings()
: QSettings(/* detos.json using JSONSettings */)
{
}
QVariant AgentSettings::value(const QString &key, const QVariant &default)
{
if (settingsCache().contains(key))
return settingsCache().value(key);
<!doctype html>
<html>
<head>
<title>test</title>
</head>
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>