Skip to content

Instantly share code, notes, and snippets.

View Boggin's full-sized avatar
💭
bleep bloop blorp

Richard Bogle Boggin

💭
bleep bloop blorp
View GitHub Profile
@Boggin
Boggin / git-tfs.markdown
Last active October 14, 2020 08:22
Git Tfs : HowTo

Git Tfs

If you would like to use git locally against the TFS repositories you can use git-tfs.

You can install git from the Windows installer: http://git-scm.com/downloads.
I prefer to install the bash command line and all the Unix tools. You may still prefer to use the GUI which is installed at the same time.

Then you can install git-tfs via chocolatey.
Note: If you don't have chocolatey goodness yet then see the Chocolatey Install section below.

@Boggin
Boggin / MyController.cs
Last active January 19, 2016 15:02
A WebAPI Controller for an Azure WebRole that can manage a request that will take a long time to fulfill.
namespace WebRole.Controllers
{
public class MyController : ApiController
{
private readonly ICache cache;
private readonly IMyRequestQueue myRequestQueue;
public MyController(
ICache cache,
@Boggin
Boggin / level-meter.css
Last active August 29, 2015 14:04
AngularJS level-meter directive.
.level-meter__content {
background: #fff;
}
.level-meter__box {
fill: none;
stroke: #7d7d7d;
}
.level-meter__bar-empty {
fill: #7d7d7d;
stroke: #7d7d7d;
@Boggin
Boggin / ApiAuthorizeAttribute.cs
Created October 17, 2013 15:46
MS Web API Authorize Attribute with Ninject 3.0
namespace Demo.WebMvc4.Infrastructure
{
using System.Web.Http;
public class ApiAuthorizeAttribute : AuthorizeAttribute
{
public Role Permission { get; set; }
// Note: Ninject currently doesn't support filter binding in Web API so this is a workaround.
protected AuthorizationService AuthorizationService
@Boggin
Boggin / IssueByNameSpecification.cs
Created October 15, 2013 16:08
Specification pattern for repository.
namespace Demo.Repository.Specifications
{
public class IssueByNameSpecification : Specification<Issue>
{
private readonly string key;
public IssueByNameSpecification(string key)
{
this.key = key;
}
@Boggin
Boggin / ApplicationContext.cs
Created October 15, 2013 16:00
Repository pattern infrastructure (with FrameLog auditing).
namespace Demo.Repository.Infrastructure
{
public class ApplicationContext : DbContext
{
public readonly FrameLogModule<ChangeSet, Person> Logger;
public ApplicationContext() : base("name=Demo")
{
Configuration.ProxyCreationEnabled = false;
Database.Initialize(true);
@Boggin
Boggin / Country.cs
Created October 15, 2013 15:48
Lookup tables for code-first Entity Framework (with auditing by FrameLog).
namespace Demo.Repository.Models
{
public class Country : Lookup
{
/// <summary>
/// Gets or sets the issues that link to this.
/// </summary>
/// <remarks>This may be referenced by many issues.</remarks>
public ICollection<Issue> Issues { get; set; }
}
@Boggin
Boggin / EmailService.cs
Created October 15, 2013 15:26
Notification service with email as an example.
namespace Demo.Notification
{
using System.Net.Mail;
public class EmailService : IEmailService
{
public void Notify(NotificationDto notification)
{
var msg = new MailMessage
{