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 / CustomService.cs
Created August 29, 2011 19:29
Debugging Windows Services
public partial class CustomService : ServiceBase
{
protected override void OnStop()
{
//normal shutdown code here
}
protected override void OnStart(string[] args)
{
//normal startup code here
@ferventcoder
ferventcoder / gist:1232364
Created September 21, 2011 15:26
Bugs 101 - Hiding content if the publish date has a time in it
/*
Consider this, both dates below are in the past. One of these will show up, the other one will not.
*/
INSERT INTO articles (PublishedDate) VALUES ('2011-09-20 07:15:25')
--this one will show up
INSERT INTO articles (PublishedDate) VALUES ('2011-09-20 00:00:00')
@ferventcoder
ferventcoder / AutomapperMapSameType.cs
Created September 22, 2011 21:20
How do you create a map without generics that can ignore destination properties? Automapper v1.1
public class Object1
{
public int Id { get; set; }
public string FirstField { get; set; }
public string SecondField { get; set; }
}
public class WhenMappingTwoItemsOfTheSameType : Spec
{
@ferventcoder
ferventcoder / chocolateyInstall.ps1
Created October 24, 2011 08:01
xunitContrib resharper "installer"
try {
$toolsDir = $(Split-Path -parent $MyInvocation.MyCommand.Definition)
$topDir = Split-Path -parent $toolsDir
$resharperPluginDir = Join-Path $topDir 'rs60\plugins'
$processor = Get-WmiObject Win32_Processor
$is64bit = $processor.AddressWidth -eq 64
$progFiles = [System.Environment]::GetFolderPath('ProgramFiles')
if ($is64bit) {$progFiles = "$progFiles (x86)"}
cmd /C "webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:WindowsInstaller31"
cmd /C "webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:WindowsInstaller45"
# Powershell
cmd /C "webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:PowerShell"
cmd /C "webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:PowerShell2"
# .NET
cmd /C "webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:NETFramework20SP2"
cmd /C "webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:NETFramework35"
@ferventcoder
ferventcoder / Story.txt
Created December 16, 2011 06:59
Awesome Story?
Let’s start with a story. Two guys, Bob and Richard need to get their computers ready to do some development work with Git. Neither Bob or Richard have worked with Git before. This is a story about the process they each go through to get Git.
Richard goes off to research. After a while he learns the tool he wants to install for Windows is mSysGit. He searches, downloads the latest version and goes to install it. He realizes he downloaded the wrong one and starts over. He may not have his settings set up properly. So then he spends time trying to figure out what his settings should be. After a process of maybe a whole morning, he finally has Git installed and hopes he is set up properly. And Richard only knows about mSysGit and not any other tools that may have helped him with using Git.
Bob has recently installed this neat tool called Chocolatey. He heads out to chocolatey.org and searches for Git. He learns that there are several cool tools for working with Git on Windows. He decides that he wants to use
@ferventcoder
ferventcoder / 1.WhatIHaveToDo.ps1
Created January 2, 2012 15:24
Pester - Script variables should reset for every describe
Describe "When installing packages from a packages.config manifest" {
$script:chocolatey_nuget_was_called = $false
$script:chocolatey_rubygem_was_called = $false
$script:chocolatey_webpi_was_called = $false
$script:packageName = ''
$script:version = ''
# content here
}
@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
// 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 / 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?