Skip to content

Instantly share code, notes, and snippets.

View asmorger's full-sized avatar

Andrew Morger asmorger

  • Monkey Jump Labs
  • Minneapolis, MN
View GitHub Profile
@asmorger
asmorger / new-system-install.sh
Last active March 30, 2020 21:15
.Net Core OSX Development
#!/bin/bash
# Requires Homebrew be installed
declare -a apps=(
"git" "gitkraken" "dotnet" "iterm2" "visual-studio-code" "rider" "datagrip" "github/gh/gh"
"nvm" "adr-tools" "monodraw" "freedom" "kiwi-for-g-suite" "alfred" "bartender" "lastpass"
"moom" "karabiner-elements" "sensei" "wget" "spotify" "ubar" "docker"
"docker-compose" "notion" "slack" "postman" "oracle-jdk" "google-cloud-sdk" "node@10"
"keyboard-maestro" "fzf" "lastpass-cli")
@asmorger
asmorger / new_system_install.ps1
Last active March 5, 2019 18:01
.Net Core Developer New System Setup Script
$packages = @(
#dev tools
"jetbrains-rider",
"dotcover",
"dotpeek",
"dotmemory",
"dottrace",
"vscode",
"gitkraken",
@asmorger
asmorger / fixSqlPrimaryKeys.sql
Created November 29, 2017 13:58
Iterate over all Table definitions in a SSDT project and fix the un-named "PRIMARY KEY" declaration and move it to a named constraint
function Needs-Updating([string] $content){
if($content -match "PK_" -and $content -match "Id"){
return $false
}
return $true
}
function Remove-PrimaryKey([string]$content){
return $content -replace " PRIMARY KEY", ""
@asmorger
asmorger / Cash Service Example
Last active February 19, 2016 12:55
Cash Service Example
public class UserService
{
[Cache]
public User GetUserById(int id)
{
// your logic goes here
}
[Cash]
public IEnumerable<UserRole> GetByUser(User user)
@asmorger
asmorger / Cash DI Registration
Last active February 26, 2016 12:49
Cash Dependency Injection Configuration
public stitac class DependencyInjectionConfiguration
{
public static void Register(ContainerBuilder builder,
ICacheKeyRegistrationService cacheKeyRegistrationService)
{
Cash.RegisterCacheInfrastructure(builder,
MemoryCache.Default,
cacheKeyRegistrationService);
builder.RegisterType<UserService>()
@asmorger
asmorger / gist:b5c523a50dcd0a5e1e20
Created May 13, 2015 11:53
Nerdery .Net Challenge #2
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using Newtonsoft.Json;
namespace ConsoleApplication1
@asmorger
asmorger / CaliburnAutofacApplication.cs
Last active November 11, 2016 15:36
Caliburn.Micro Application Bootstrapper to replace the default DI container with Autofac
namespace MyApplication.CustomBootstrapper
{
public abstract class CaliburnAutofacApplication : CaliburnApplication
{
protected IContainer Container;
private readonly ContainerBuilder _builder;
private FrameAdapter _rootFrame;
protected CaliburnAutofacApplication()
{