Skip to content

Instantly share code, notes, and snippets.

Morten Holmgaard mortenholmgaard

  • Vertica A/S
  • Denmark
View GitHub Profile
mortenholmgaard / checkout.rb
Created Aug 12, 2019
Checkout branch or create branch if it does not exist
View checkout.rb
sh("git checkout stage", log: false)
puts "git checkout stage"
rescue => ex
sh("git checkout -b stage")
View currentBranch.rb
def currentBranch()
branch = git_branch()
if !branch.to_s.empty?
return branch
git =, '../')) # git_branch() does not seem work on Windows, it will print error with path not found.
return git.current_branch
mortenholmgaard / Fastfile
Created Aug 9, 2019
Fastfile example for Android on Windows
View Fastfile
# This is our Android Fastlane template
# We are using this plugin: gem 'fastlane-plugin-android_versioning'
# And have a Appfile with json_key_file("***") and package_name("***")
require 'git'
require 'fileutils'
mortenholmgaard / Gemfile
Last active Apr 30, 2020
Fastlane Android app environment setup on Windows
View Gemfile
source ""
ruby ">= 2.6.0"
gem "fastlane", ">= 2.126.0"
gem "git"
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
mortenholmgaard / setup-windows.ps1
Created Aug 9, 2019
Fastlane Android app environment setup on Windows
View setup-windows.ps1
#Requires -RunAsAdministrator
Function DoesCommandExists {
Param ($command)
try { if(Get-Command $command){ return $true } }
catch { return $false }
mortenholmgaard / ImportProductImagesJob.cs
Last active Dec 1, 2017
Azure blob image provider for Episerver commerce product images
View ImportProductImagesJob.cs
private readonly ProductImageContentProvider _productImageContentProvider;
private void AddImageInEpiServerBackend(string colorProductCode, string imageName)
var colorProductLink = _referenceConverterFactory.GetReferenceConverter().GetContentLinks(new []{ colorProductCode }).Values.FirstOrDefault();
ColorProduct colorProduct = _contentRepository.Get<ColorProduct>(colorProductLink).CreateWritableClone() as ColorProduct;
ProductImageFile productImageFile = _productImageContentProvider.ConvertToProductImageFile(imageName);
colorProduct.CommerceMediaCollection.Add(new CommerceMedia
You can’t perform that action at this time.