Skip to content

Instantly share code, notes, and snippets.


Daniel Phoebus dphoebus

  • CaptiveAire, Inc.
View GitHub Profile
# Clean up backup and loose objects.
git for-each-ref --format='delete %(refname)' refs/original | git update-ref --stdin
git reflog expire --expire=now --all
git gc --prune=now
# 全ての履歴に .gitignore / .gitattributes を追加する
git filter-branch --index-filter "cp -t ./ ../.gitignore ../.gitattributes && git add .gitignore .gitattributes" -f -- --all
dphoebus /
Created Aug 7, 2019 — forked from jkomyno/
Get every globally install npm package
npm list -g --depth 0
View 404.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Single Page Apps for GitHub Pages</title>
<script type="text/javascript">
// Single Page Apps for GitHub Pages
// Copyright (c) 2016 Rafael Pedicini, licensed under the MIT License
// ----------------------------------------------------------------------
dphoebus / safari-nomodule.js
Created Aug 1, 2019 — forked from samthor/safari-nomodule.js
Safari 10.1 `nomodule` support
View safari-nomodule.js
* Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will
* load <script nomodule> anyway. This snippet solve this problem, but only for script
* tags that load external code, e.g.: <script nomodule src="nomodule.js"></script>
* Again: this will **not** prevent inline script, e.g.:
* <script nomodule>alert('no modules');</script>.
* This workaround is possible because Safari supports the non-standard 'beforeload' event.
* This allows us to trap the module and nomodule load.
dphoebus /
Created Aug 28, 2018 — forked from troyanov/
Generate Enums from database lookup tables. - t4 helper class, that uses EnvDTE to get all Projects in Solution, configurations, etc. - generates enums for tables by criteria enumDescriptionColumnName
<#@ template debug="true" hostspecific="true" language="C#" #>
<#@ output encoding="utf-8" extension=".cs"#>
<#@ assembly name="EnvDTE" #>
<#@ assembly name="EnvDTE80" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="System.Configuration" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Configuration" #>
<#@ import namespace="System.Text.RegularExpressions" #>
<#@ import namespace="EnvDTE" #>
dphoebus / LocalDB Reset
Created Mar 13, 2018 — forked from hanssens/LocalDB Reset
Reset SQL's LocalDB, after corrupt rights or other problems.
View LocalDB Reset
# After problems with a company-wide ActiveDirectory shaker, all (local) SQL Server instances were FUBAR.
# This 'resets' the LocalDB sql instance.
sqllocaldb stop "v11.0" -k
sqllocaldb delete "v11.0"
sqllocaldb create "v11.0"
sqllocaldb start "v11.0"
View CQRSWithMediatR.txt
Simple mediator implementation in .NET for In-process messaging.
Supports request/response, commands, queries, notifications and events, synchronous and async with intelligent dispatching via C# generic variance.
Workflow is kind of container for business logic. It could combine set of queries and commands into single operation which matters to end user.
View BaseAggregateRoot.cs
namespace Cqrs.Domain
using System;
using Messages;
public abstract class BaseAggregateRoot<TAggregate> : IAggregateRoot
where TAggregate : class, IAggregateRoot
private static readonly IDispatchMessages<TAggregate> Dispatcher = new MessageDispatcher<TAggregate>();
View Simplified--No Nested Transactions
using System;
using System.Diagnostics;
using System.Linq;
using System.Transactions;
using Raven.Client;
using Raven.Client.Document;
using Raven.Client.Linq;
public class Program
View gist:35de2c9638c4557fd8a3f91f6bfc888f
public sealed class NServiceBusCommitDispatcher : IPublishMessages
private const string AggregateIdKey = "AggregateId";
private const string CommitVersionKey = "CommitVersion";
private const string EventVersionKey = "EventVersion";
private const string BusPrefixKey = "Bus.";
private readonly IBus bus;
public NServiceBusCommitDispatcher(IBus bus)
You can’t perform that action at this time.