Skip to content

Instantly share code, notes, and snippets.

View stefanwalther's full-sized avatar
🏠
Working from home

Stefan Walther stefanwalther

🏠
Working from home
View GitHub Profile
@stefanwalther
stefanwalther / version_compare.js
Last active August 29, 2015 14:01 — forked from TheDistantSea/version_compare.js
Version Compare (js)
/**
* Compares two software version numbers (e.g. "1.7.1" or "1.2b").
*
* This function was born in http://stackoverflow.com/a/6832721.
*
* @param {string} v1 The first version to be compared.
* @param {string} v2 The second version to be compared.
* @param {object} [options] Optional flags that affect comparison behavior:
* <ul>
* <li>
text-overflow: ellipsis;
overflow: hidden;
width: 250px;
white-space: nowrap;
display: block;

Easiest Table of Contents possible

In .verb.md where you want to inject the TOC:

<!-- toc -->

Done!

@stefanwalther
stefanwalther / QRS-Listapps.js
Created September 30, 2015 15:04 — forked from mindspank/QRS-Listapps.js
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');
@stefanwalther
stefanwalther / gist:4027833
Created November 6, 2012 21:51
VBScript: Delete all files by a given fileMask
'// *****************************************************************
'// Delete all files by a given fileMask
'// ~~
'// Example:
'// DeleteFiles("C:\temp\*.txt")
'// or
'// DeleteFile("*.log") => will delete all .log files in the
'// current folder
'// *****************************************************************
Sub DeleteFiles(ByVal fileMask)
@stefanwalther
stefanwalther / QvExt_ConsoleHelper.js
Last active December 28, 2015 16:48
Helper functions to encapsulate console output for QlikView extensions.
// ------------------------------------------------------------------
// QlikView Extension helper functions for sending some messages
// to console output
// (prevents errors if console object is not available)
// ------------------------------------------------------------------
function ConsoleLog(msg) {
if (typeof console != "undefined") {
console.log(msg);
}
}
@stefanwalther
stefanwalther / QvExt_LoadCSS.js
Last active December 28, 2015 16:49
Load CSS files in QlikView Object Extensions (QlikView 11).
// Define one or more styles sheets to be used within the extension
var cExtensionName = 'ExtensionName';
var cssFiles = [];
cssFiles.push('Extensions/' + cExtensionName + '/lib/css/style.css');
cssFiles.push('Extensions/' + cExtensionName + '/lib/css/style2.css');
for (var i = 0; i < cssFiles.length; i++) {
Qva.LoadCSS(Qva.Remote + (Qva.Remote.indexOf('?') >= 0 ? '&' : '?') + 'public=only' + '&name=' + cssFiles[i]);
}
@stefanwalther
stefanwalther / QvExt_LoadJSFiles.js
Created November 18, 2013 16:46
Define one or more javascript files to be loaded within a QlikView object extension (QlikView 11).
// Define one or more javascript files to be used within the extension
var cExtensionName = 'ExtensionName';
var jsFiles = [];
jsFiles.push('Extensions/' + cExtensionName + '/lib/js/BaseUtils.js');
jsFiles.push('Extensions/' + cExtensionName + '/lib/js/ExtensionUtils.js');
Qv.LoadExtensionScripts(jsFiles, function () {
// Initialize the extension
//Init();
@stefanwalther
stefanwalther / JSStringExtensions.js
Created November 18, 2013 16:50
A collection of useful JavaScript string extensions.
// ------------------------------------------------------------------
// General Utils
// ------------------------------------------------------------------
function nullOrEmpty(obj) {
if (obj == null || obj.length == 0 || obj == 'undefined') {
return true;
}
return false;
}
@stefanwalther
stefanwalther / QvExt_SetVarValue.js
Created November 26, 2013 15:24
Set a variable value from within a QlikView extension.
function setVariableValue(varName, val) {
var qvDoc = Qv.GetCurrentDocument();
qvDoc.SetVariable(varName, val);
}