Skip to content

Instantly share code, notes, and snippets.

@mindspank
mindspank / gist:17e518f67f674c3caae5
Last active May 9, 2016 05:55
Grab object IDs
(function() {
(function foo(node) {
if (node && node.$id) {
if (node.$$childHead) foo(node.$$childHead);
if (node.$$nextSibling) foo(node.$$nextSibling);
if (node.model && node.model.layout) node.model.layout.title = node.model.id;
}
})(qvangularGlobal.$rootScope);
$('*').css('-webkit-user-select', 'all');
pubsub.publish('/resize/end')
@mindspank
mindspank / index.html
Created May 7, 2015 21:10
Leverage qsocks from within a mashup
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://sense-demo.qlik.com/resources/autogenerated/qlikui.css">
@mindspank
mindspank / gist:e1c51c04c7a7053e19f3
Last active December 9, 2016 10:11
Qlik Sense API overview

Qlik Sense Proxy Service API, Qlik Sense Repository Service API and Qlik Sense User Directory Connector API are REST API and can be consumed from all languages and environments that supports REST.

Qlik Sense QVX SDK and Qlik Sense .Net SDK are .Net libraries that can be consumed from all languages and environments that supports .Net such as the Windows plattform.

The Qlik Sense Backend, Extension and Mashup API are javascript libraries.

The Qlik Sense Engine API is a web socket API that can be consumed by all languages and environments that supports web socket.

/* Workbench */
Qv.InitWorkBench({
View: 'FirstVersion',
Host: null,
Anonymous: true,
BodyOnLoadFunctionNames: ['init'],
InitialSelections: ['LB137,Moderaterna']
});
var Data = {
title: 'Member State',
row: [{
state: 'S',
qText: 'Europe'
},{
state: 'S',
qText: 'Asia'
},{
state: 'S',
@mindspank
mindspank / gist:d410e67953a62f305199
Created June 8, 2015 13:54
Multiple scoped connections with qsocks
var CORE = {
host: 'sense-demo.qlik.com',
isSecure: true,
appname: null
};
var APP1 = {
host: 'sense-demo.qlik.com',
isSecure: true,
appname: '5621cc5b-0bad-49d8-94c3-bef3aa5d8e84'
@mindspank
mindspank / QES-NoProxy-Certs.js
Last active March 31, 2017 11:25
QES-NoProxy-Certs.js
var WebSocket = require('ws');
var fs = require('fs');
var ws = new WebSocket('wss://usrad-akl:4747/app/', {
origin: 'https://usrad-akl', // <- This origin has to be in the WebSocket White list of Qlik Sense
cert: fs.readFileSync(__dirname + '/client.pem'),
key: fs.readFileSync(__dirname + '/client_key.pem'),
headers: {
'X-Qlik-User': 'UserDirectory=Internal;UserId=sa_repository' // Passing a user to QIX to authenticate as
},
@mindspank
mindspank / QES-qsocks-connect.js
Last active August 29, 2015 14:24
QES-qsocks-connect.js
var qsocks = require('qsocks');
var fs = require('fs');
var request = require('request');
// Set our request defaults, ignore unauthorized cert warnings as default QS certs are self-signed.
// Export the certificates from your Qlik Sense installation and refer to them
var r = request.defaults({
rejectUnauthorized: false,
host: 'usrad-akl',
key: fs.readFileSync(__dirname + '/client_key.pem'),
@mindspank
mindspank / QRS-Listapps.js
Created July 2, 2015 20:26
QRS-Listapps.js
/**
* Connects to the QRS API (REST based) using certificates.
* See this article for more information about connecting to QRS https://help.qlik.com/sense/2.0/en-us/developer/Subsystems/RepositoryServiceAPI/Content/RepositoryServiceAPI/RepositoryServiceAPI-Connect-API.htm
*
*/
var https = require('https');
var fs = require('fs');
@mindspank
mindspank / gist:ff8b2cebac911a622477
Created July 10, 2015 16:23
Reload Task By Name - QRS API
/**
* Connects to the QRS API (REST based) using certificates.
* See this article for more information about connecting to QRS https://help.qlik.com/sense/2.0/en-us/developer/Subsystems/RepositoryServiceAPI/Content/RepositoryServiceAPI/RepositoryServiceAPI-Connect-API.htm
*
*/
var https = require('https');
var fs = require('fs');