Skip to content

Instantly share code, notes, and snippets.

View mortenholmgaard's full-sized avatar

Morten Holmgaard mortenholmgaard

  • Vertica A/S
  • Denmark
View GitHub Profile
@mortenholmgaard
mortenholmgaard / Gemfile
Last active March 20, 2023 20:56
Fastlane Android app environment setup on Windows
source "https://rubygems.org"
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
mortenholmgaard / Fastfile
Created August 9, 2019 12:06
Fastfile example for Android on Windows
# 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'
default_platform(:android)
@mortenholmgaard
mortenholmgaard / Skeleton.kt
Created March 3, 2021 08:27
Skeleton usages example
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.annotation.ColorRes
import androidx.core.content.ContextCompat
import androidx.interpolator.view.animation.FastOutSlowInInterpolator
import com.eudycontreras.boneslibrary.bindings.getBoneDrawable
import com.eudycontreras.boneslibrary.bindings.getSkeletonDrawable
import com.eudycontreras.boneslibrary.extensions.dp
@mortenholmgaard
mortenholmgaard / checkout.rb
Created August 12, 2019 12:35
Checkout branch or create branch if it does not exist
begin
sh("git checkout stage", log: false)
puts "git checkout stage"
rescue => ex
sh("git checkout -b stage")
end
def currentBranch()
branch = git_branch()
if !branch.to_s.empty?
return branch
end
git = Git.open(File.join(File.dirname(__FILE__), '../')) # git_branch() does not seem work on Windows, it will print error with path not found.
return git.current_branch
end
@mortenholmgaard
mortenholmgaard / setup-windows.ps1
Created August 9, 2019 12:03
Fastlane Android app environment setup on Windows
#Requires -RunAsAdministrator
$RUBY_VERSION = "2.6.3.1"
Function DoesCommandExists {
Param ($command)
try { if(Get-Command $command){ return $true } }
catch { return $false }
}
@mortenholmgaard
mortenholmgaard / ImportProductImagesJob.cs
Last active December 1, 2017 06:55
Azure blob image provider for Episerver commerce product images
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