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 / RenameGitBranch.md
Created January 5, 2024 17:18 — forked from danieldogeanu/RenameGitBranch.md
How to rename your Git master branch to main.

To rename your Git master branch to main, you must do the following steps:

  1. Navigate to your repository in the command line and issue the following commands: - git branch -m master main - git push -u origin main

  2. Change your default branch on GitHub by going to your GitHub repository in your browser, and navigate to Settings > Branches and click on the dropdown and switch from master to main and click Update (this will only show if you have two or more branches). The main branch is now your default branch.

  3. Update the tracking of the branch from your command line with the following command: - git branch -u origin/main main

@stefanwalther
stefanwalther / HttpStatusCode.ts
Created December 22, 2023 19:58 — forked from scokmen/HttpStatusCode.ts
Typescript Http Status Codes Enum
"use strict";
/**
* Hypertext Transfer Protocol (HTTP) response status codes.
* @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}
*/
enum HttpStatusCode {
/**
* The server has received the request headers and the client should proceed to send the request body
@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 / multiple_ssh_setting.md
Created March 30, 2020 20:45 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@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 / 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 / mongoose.js
Created December 17, 2016 22:22 — forked from bayleedev/mongoose.js
A better syntax for mongoose instance and static methods.
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/foobar');
// bootstrap mongoose, because syntax.
mongoose.createModel = function(name, options) {
var schema = new mongoose.Schema(options.schema);
for (key in options.self) {
if (typeof options.self[key] !== 'function') continue;
schema.statics[key] = options.self[key];
}
@stefanwalther
stefanwalther / loadscript.vbs
Created March 15, 2016 20:19
Dynamic Qlik Load Script
// Change the amount here to create more records
SET vAmountTransactions=10000;
Characters:
Load Chr(RecNo()+Ord('A')-1) as Alpha, RecNo() as Num autogenerate 26;
ASCII:
Load
if(RecNo()>=65 and RecNo()<=90,RecNo()-64) as Num,
Chr(RecNo()) as AsciiAlpha,
@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
@stefanwalther
stefanwalther / README-Template.md
Created July 26, 2017 16:20 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites