Skip to content

Instantly share code, notes, and snippets.

View countnazgul's full-sized avatar

Stefan Stoichev countnazgul

View GitHub Profile
import * as qs from "qs";
import { PathLike } from "fs";
export const apiConfig = {
returnRejectedPromiseOnError: true,
withCredentials: true,
timeout: 30000,
baseURL: "https://jsonplaceholder.typicode.com/",
headers: {
common: {
@skokenes
skokenes / Qlik Core Command Line Interface Proposal.md
Last active May 8, 2018 22:38
A proposal for a Qlik Core CLI tool for quickly working with QVFs

Proposal

A CLI tool that leverages Qlik Core to report on basic metadata about a QVF.

Motivation

Qlik Core leverages QVF files to store data models that you can interact with via the Qlik Associative Engine. These QVF files, like any file, are black boxes until you open them up and look inside. While developing solutions on top of Qlik Core, it can be difficult to understand what is going on with your QVF - what data is in there, what objects, etc. Writing scripts via enigma.js or RxQ to simply get a list of fields from a QVF that you are building on top of is cumbersome.

Eventually, I expect that Qlik, partners, and customers will build an ecosystem of nice dev tools for working with Core. In the meantime, I propose a CLI tool as a first step that can provide key metadata about QVFs in a quick and easy way.

Existing Solutions

There are no published solutions (that I'm aware of) today for easily working with Core across platforms. [Alex Karlsson](https://twitter.com/mindspank/status/99111532994953216

@3v1n0
3v1n0 / keybindings.json
Last active January 23, 2024 05:53
VSCode keybindings for alternative HJLK navigation, when using non-vim mode and support for quick panel navigation with Tab/Shift+Tab.
/* VSCode keybindings for alternative HJLK navigation, when using non-vim mode
* and support for quick panel navigation with Tab/Shift+Tab.
*
* So basically I just tried to use everywhere in the editor these aliases:
* Alt+j = down
* Alt+k = up
* Alt+l = right
* Alt+h = left
* Alt+b = previous-word
* Alt+w = next-word
@alexsasharegan
alexsasharegan / wrapErr.ts
Created January 25, 2018 17:26
Go-like error handling with Typescript.
export async function wrapErr<T>(p: Promise<T>): Promise<[any, T | undefined]> {
try {
return [undefined, await p];
} catch (err) {
return [err, undefined];
}
}
let [err, value] = await wrapErr(somePromiseFunc());
if (err) {
var engine_js = {
"ErrorCode.-128": "Internal engine error",
"ErrorCode.-1": "Unknown error",
"ErrorCode.0": "Unknown error",
"ErrorCode.1": "Some data is not correctly specified.",
"ErrorCode.2": "The resource could not be found.",
"ErrorCode.3": "Resource already exists.",
"ErrorCode.4": "Invalid path",
"ErrorCode.5": "Access is denied",
"ErrorCode.6": "The system is out of memory.",
@lucasscariot
lucasscariot / model-user.js
Last active June 22, 2023 17:08
Composite Primary Key in Sequelize
/*
* Migration
*/
'use strict';
module.exports = {
up: function(queryInterface, Sequelize) {
return queryInterface.createTable('Users', {
firstName: {
type: Sequelize.STRING
},
@mindspank
mindspank / 10session.js
Created September 16, 2016 15:15
10 session apps
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: 'localhost',
pfx: fs.readFileSync(__dirname + '\\client.pfx')
@mindspank
mindspank / embedsheet.js
Last active January 17, 2022 05:16
Emulate a Qlik Sense sheet using the Capabilities API
var prefix = window.location.pathname.substr( 0, window.location.pathname.toLowerCase().lastIndexOf( "/extensions" ) + 1 );
var config = {
host: window.location.hostname,
prefix: prefix,
port: window.location.port,
isSecure: window.location.protocol === "https:"
};
require.config( {
baseUrl: ( config.isSecure ? "https://" : "http://" ) + config.host + (config.port ? ":" + config.port: "") + config.prefix + "resources"
} );
@mindspank
mindspank / require url.js
Last active April 15, 2016 20:39
url to require url #extension
define( ["require"], function ( localRequire ) {
var path = localRequire.toUrl( "extensions/d3-vis-library/d3-vis-library.css" );
});
@nate-untiedt
nate-untiedt / wblGen.bat
Last active October 8, 2021 00:33
A simple batch file that automatically generates the wblfolder.wbl for your Qlik Sense visualization extension.
@echo off
REM wblGen.bat - v 1.0.0 - 2015-10-09
REM Description:
REM A simple batch file that automatically generates the wblfolder.wbl for your Qlik Sense visualization extension.
REM
REM Author: Nate Untiedt - Analytics8 - nuntiedt@analytics8.com
REM
REM Credit to: http://stackoverflow.com/a/8387078
setlocal EnableDelayedExpansion