Skip to content

Instantly share code, notes, and snippets.


Robert Dailey rcdailey

View GitHub Profile
rcdailey / CompositionRootTest.cs
Created Jan 22, 2022
Demonstration of how to write specialized tests for resolving types with constructor parameters that are not themselves registered
View CompositionRootTest.cs
public record ServiceFactoryWrapper(Type Service, Action<ILifetimeScope> Instantiate);
public static class FactoryForService<TService>
public static ServiceFactoryWrapper WithArgs<TP1>(TP1 arg1 = default!)
return new ServiceFactoryWrapper(typeof(TService),
c => c.Resolve<Func<TP1, TService>>().Invoke(arg1));
rcdailey / MyPage.razor
Created Jun 18, 2021
CascadingValue is null
View MyPage.razor
@page "/mypage"
@if (stuff)
<div>More Stuff</div>
View gist:944450796c7b2afe0707e62f28a88ec5
rcdailey /
Created Apr 3, 2019
How to ignore certain commits when doing a merge

You can ignore commits during a merge by selectively cherry-picking the commits you want to keep, followed by a merge that ignores all upstream changes. Example below.

Suppose I have the following branch commits:

  • topic
  • topic~1
  • topic~2
  • topic~3
rcdailey / .gitconfig
Created Apr 20, 2018
Recommended basic git configuration (goes in global .gitconfig)
View .gitconfig
autocrlf = false
default = current
rebase = true
autoSquash = true
autoStash = true
View android_armeabi-v7a.toolchain.cmake
include( ${CMAKE_CURRENT_LIST_DIR}/android_common.toolchain.cmake )
set( CMAKE_SYSTEM_NAME Android )
set( CMAKE_SYSTEM_VERSION 15 ) # API level
set( CMAKE_ANDROID_ARCH_ABI armeabi-v7a )
set( CMAKE_ANDROID_STL_TYPE gnustl_shared )
# Used by the copy_dlls target later on. These will be packaged with any APK built
# so that they are available by the runtime on the device.
View main.cmake
# Read the version of Android NDK
file( READ ${CMAKE_ANDROID_NDK}/ ndk_properties )
string( REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" CMAKE_ANDROID_NDK_VERSION ${ndk_properties} )
message( STATUS "Android NDK Version: ${CMAKE_ANDROID_NDK_VERSION}" )
# Limit unified header usage to NDK r15b and greater (v15.1)
# Unified headers were introduced in r14, but are too buggy for our use.
message( STATUS "Unified headers are ENABLED" )
View Catch Test (#472)
Test for issue:
rcdailey / gist:f976279ed154eff2eeba
Last active Apr 13, 2020 — forked from dsc/gist:3855240
Python argparse Cheatsheet
View gist:f976279ed154eff2eeba
Arg Name or Optional Flags:
positional : str = "foo"
options : str = "-f", "--foo"
action : str = [store], append, store_true, store_false, store_const, append_const, version
default : * = [None]
type : callable = [str], argparse.FileType(mode='wb', bufsize=0)
rcdailey / Bamboo Plan Branch Deleter
Last active Jan 11, 2021
A python 3.x script that may be used to delete plan branches in a given bamboo instance. Utilizes HTTP calls to perform the task. Requires the 'requests' python library. Install via 'pip install requests'.
View Bamboo Plan Branch Deleter
Uses web API to bulk-delete plan branches