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 / 1. handlebars-subexpression.html
Created March 8, 2016 18:31 — forked from jonschlinkert/1. handlebars-subexpression.html
Very powerful combination! Four helpers are used here: `each`, `expand`, `markdown` and `inline`.
{{#each (expand 'content/*.md')}}
{{#markdown}}
{{inline .}}
{{/markdown}}
{{/each}}
@stefanwalther
stefanwalther / CodeDeploy Policy
Created January 8, 2016 23:41 — forked from flomotlik/CodeDeploy Policy
Amazon IAM Policies for Codeship
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"codedeploy:RegisterApplicationRevision",
"codedeploy:GetApplicationRevision"
],
"Resource": [
@stefanwalther
stefanwalther / Enum.es6.js
Created October 16, 2015 15:08 — forked from xmlking/Enum.es6.js
JavaScript Enums with ES6, Type Checking and Immutability
export class EnumSymbol {
sym = Symbol.for(name);
value: number;
description: string;
constructor(name: string, {value, description}) {
if(!Object.is(value, undefined)) this.value = value;
if(description) this.description = description;
@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 / Ascii-Folder-Structure.md
Last active September 22, 2017 14:28
Folder structure with Ascii characters.
| [root]
|── config
    |── data
    |── helpers
    |── layouts
    |── less
    |── partials
|── docs
| assemblefile.js

Easiest Table of Contents possible

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

<!-- toc -->

Done!

text-overflow: ellipsis;
overflow: hidden;
width: 250px;
white-space: nowrap;
display: block;
@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);
}
@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 / 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