Skip to content

Instantly share code, notes, and snippets.

View christianhelle's full-sized avatar

Christian Helle christianhelle

View GitHub Profile
@christianhelle
christianhelle / git-commit-files.ps1
Created March 26, 2023 09:26
git commit one file at a time from powershell
git add .
git ls-files | Get-ChildItem | Select-Object -Property $_.Name | ForEach-Object { git commit -m "Update $_" $_ }

Keybase proof

I hereby claim:

  • I am christianhelle on github.
  • I am christianhelle (https://keybase.io/christianhelle) on keybase.
  • I have a public key ASB6v0Ocu36KRobTG05ielVCOsQOT8mqeB_ufPLVFj9q6Qo

To claim this, I am signing this object:

@christianhelle
christianhelle / Dockerfile
Created April 15, 2020 10:51
Dockerfile for Azure Functions for Powershell with Azure CLI
FROM mcr.microsoft.com/azure-functions/powershell:2.0
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
#!/bin/bash
find . -name ".git" -type d | sed 's/\/.git//' | xargs -I{} sh -c 'echo {}; git -C {} log --pretty=format:"%h - %ad - %an - %s" --after="2019-10-01"'
@christianhelle
christianhelle / LinqExtensions.cs
Created November 19, 2019 08:12
LinqExtensions
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Configuration;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
namespace System.Linq.Extensions
@christianhelle
christianhelle / git-pull-all-repos.sh
Created October 15, 2019 10:37
Pulls all git repositories from a folder
#!/bin/bash
find . -name ".git" -type d | sed 's/\/.git//' | xargs -P10 -I{} git -C {} pull
@christianhelle
christianhelle / update-phimagemanager-header.sh
Last active November 26, 2019 08:52
Workaround for building Xamarin.iOS after updating to XCode 11 for the error: PHImageManager.h(17,47): error GEA45E82A: expected identifier or '{'
#!/bin/bash
sudo sed -i -e 's/typedef NS_ENUM(NSInteger, UIImageOrientation);/typedef NS_ENUM(NSInteger, UIImageOrientation) {};/g' /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHImageManager.h
@christianhelle
christianhelle / stream-csv.cs
Last active September 11, 2018 10:14
Stream CSV from Web API
[Route("foo/{id}/data/export", Name = nameof(GetCsvData))]
public async Task<HttpResponseMessage> GetCsvData(int id)
{
var foo = await FooRepository.GetByIdAsync(id);
if (foo == null)
return new HttpResponseMessage(HttpStatusCode.NoContent);
var streamContent = new PushStreamContent(async (stream, content, arg3) =>
{
try

Code Signing

Command line

"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\signtool.exe" sign /f "[pfx file]" /p "[private key password]" /tr [time stamp server url] /td SHA256 "[path to assembly]"

Post build event Visual Studio Project

if $(ConfigurationName) == Release $(SolutionDir)..\Certificates\signtool.exe sign /f $(SolutionDir)..\[Certificate Directory]\[pfx file].pfx /p "[private key password]" /tr [time stamp server url] /td SHA256 $(TargetDir)*.exe
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Migrations;
using System.Linq;
using System.Threading.Tasks;
namespace ChristianHelle.Toolbox.Data.Repositories
{
public interface IDatabaseContextFactory