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 / 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);
}
@stefanwalther
stefanwalther / Batch_PostBuild_QlikViewExtension.bat
Last active December 29, 2015 13:09
Batch file for deploying a Qlikview Extension in Visual Studio using as post build event.
@@echo off
set TARGET_PATH=C:\Users\%USERNAME%\AppData\Local\QlikTech\QlikView\Extensions\Objects
set EXTENSION_NAME=%~1
set VS_TARGET_DIR=%~2
set VS_TARGETNAME=%~3
set VS_TARGETFILENAME=%~4
echo.-------------------------
echo.Settings for local extension deployment:
@stefanwalther
stefanwalther / QlikView_SaveTables_ToQVDs.qvs
Last active September 10, 2019 17:32
QlikView Script: Save all tables to QVD files.
// '.\' is the current path
// Define the path here, if required ...
SET basePath = '.\';
TRACE ---------------------------------------------------------------;
TRACE Saving tables ... ;
TRACE ~~;
For i = 0 To NoOfTables() -1
@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>
@stefanwalther
stefanwalther / Backup_MongoDB.ps1
Created December 30, 2014 20:43
Powershell to backup all local MongoDB databases
$date = Get-Date -UFormat %Y-%m-%d;
$backupFolder = $date;
$basePath = "C:\bla";
$destinationPath = Join-Path $basePath $backupFolder;
if(!(Test-Path -Path $destinationPath)) {
New-Item -ItemType directory -Path $destinationPath;
(C:\mongodb\bin\mongodump.exe --out $destinationPath);
}