Skip to content

Instantly share code, notes, and snippets.

View ferventcoder's full-sized avatar
🎯
Focusing

Rob Reynolds ferventcoder

🎯
Focusing
View GitHub Profile
@ferventcoder
ferventcoder / Errors.txt
Created June 28, 2012 05:30
Weird error...when upgraded to nuget 2.0
Pushing to custom source
Failed to process request. 'The schema version of 'package' is incompatible w
ith version 1.6.21205.9031 of NuGet. Please upgrade NuGet to the latest version
from http://go.microsoft.com/fwlink/?LinkId=213942.'. The remote server returne
d an error: (500) Internal Server Error..
@ferventcoder
ferventcoder / 1_UserRepositoryLinqService.cs
Last active October 6, 2015 13:17
RepositoryPattern with Linq Query Services
namespace SomeProject.Infrastructure.App.Services
{
/// <summary>
/// Houses the queries against users in the database
/// </summary>
public class UserRepositoryService : BaseRepositoryService<User>, IUserRepositoryService
{
private readonly IDateTimeService _dateTimeService;
/// <summary>
@ferventcoder
ferventcoder / ReduceThatDB.sql
Created June 16, 2012 12:48
D to the B to the A - Reducing the size of a SQL Server database
/*
* Scripts to remove data you don't need here
*/
/*
* Now let's clean that DB up!
*/
DECLARE @DBName VarChar(25)
@ferventcoder
ferventcoder / SomeController.cs
Created April 24, 2012 16:51
Clean controllers in ASP.NET MVC
using System.Web.Mvc;
using WebProject.Domain;
using WebProject.Infrastructure.App.Services;
using WebProject.Web.Models;
namespace WebProject.Web.Controllers
{
public class SomeController : BaseController<SomeModel, SomeDomain>
{
@ferventcoder
ferventcoder / Where.ps1
Created April 4, 2012 21:14
Somebody's where.exe implementation as powershell ;)
$exe = 'git';
if($exe.EndsWith('.exe') -or $exe.EndsWith('.bat')) { $exe = $exe.Substring(0, $exe.Length - 4)}; (ls env:\path).Value.split(';') | %{ if( test-path "$_\$exe.exe" ) { ls "$_\$exe.exe" }; if( test-path "$_\$exe.bat" ) { ls "$_\$exe.bat" }; } | %{ if($_.FullName.EndsWith('.exe') -or $_.FullName.EndsWith('.bat')) { $_.FullName } }
@ferventcoder
ferventcoder / EnumerationExtensions.cs
Created April 4, 2012 19:04
MVC Html DropDownListHelper
public static class EnumerationExtensions
{
public static IEnumerable<SelectListItem> GetEnumerationItems(this Enum enumeration)
{
var listItems = Enum
.GetValues(enumeration.GetType())
.OfType<Enum>()
.Select(e =>
new SelectListItem()
{
@ferventcoder
ferventcoder / InstallChocolatey.cmd
Created April 2, 2012 21:38
Chocolatey One Line Install from the command line
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://bit.ly/psChocInstall'))";
@ferventcoder
ferventcoder / ItemsNotCovered.txt
Created March 14, 2012 22:08
Packages Config answer for Dru
windows updates
msmq
visual studio
beyond compare
.gitconfig
.bash_profile
erlang->rabbitmq?
// one way mapping shown for clarity sake and lots of ForMember() relationships removed
public class AutoMapperProfileWeb : Profile
{
public override string ProfileName
{
get { return "SomeApp.Web"; }
}
protected override void Configure()
@ferventcoder
ferventcoder / Session1.txt
Created January 4, 2012 21:58
Session Submissions for KC DC 2012
Automated Testing, but Like for PowerShell
==========================================
PS \> Invoke-TestThisShiz.ps1
So you say automated testing is important?
And you are kind of digging the awesome power of PowerShell
and want to learn more? What if there was some way to really test
PowerShell scripts in a behavior driven way? We'll explore the
concepts of automated testing (unit, integration, etc) and how