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 / 0GenericRepository.cs
Created August 16, 2012 17:21
Db First Generic Repository with DbFirst Model First - allows use of stored procedures transparently - it's no coincidence that the IRepository is the same as code first implements
public class EntityFrameworkDatabaseFirstRepository : IRepository
{
private readonly IDatabaseFirstDataContext _dataContext;
/// <summary>
/// Gets the data context.
/// </summary>
protected IDatabaseFirstDataContext DataContext
{
get
@ferventcoder
ferventcoder / Chocolatey goodness - What....md
Created September 16, 2012 03:33
Session Submissions for Iowa Code Camp - http://www.iowacodecamp.com

Chocolatey is a global PowerShell execution engine. What does that mean? I'm not sure but it does some really cool stuff.

For instance, if you lose your car keys you can just pull up a command line and type - chocolatey where are my keys? and it will respond with "Please run chocolatey /? or chocolatey help".

Okay bad example, but it definitely does some cool things like save you time and make you look uber smart for using it. Come see what this thing is and what it can do for you.

"Sometimes it's the tools that make the man." -Rob Reynolds, like 2 seconds ago

@ferventcoder
ferventcoder / CassetteConfiguration.cs
Created September 21, 2012 06:16
Cassette Configuration
/// <summary>
/// Bundles the Javascript and CSS files for the web application based on conventions set here.
/// </summary>
public class CassetteConfiguration : ICassetteConfiguration
{
/// <summary>
/// Configures the specified bundles.
/// </summary>
/// <param name="bundles">The bundles.</param>
/// <param name="settings">The settings.</param>
@ferventcoder
ferventcoder / RemoveListItem.cs
Created September 24, 2012 22:29
How to Remove Items from A List ?
foreach (var item in items.ToList())
{
items.Remove(item);
}
@ferventcoder
ferventcoder / setup.ps1
Last active February 25, 2025 06:02
Really rocking out the environment setup
$scriptDir = $(Split-Path -parent $MyInvocation.MyCommand.Definition)
function Install-NeededFor {
param(
[string] $packageName = ''
,[bool] $defaultAnswer = $true
)
if ($packageName -eq '') {return $false}
$yes = '6'
@ferventcoder
ferventcoder / .gitconfig
Created October 8, 2012 14:13
Git Alias for pushing changes and syncing up
[alias]
sendwork = !git checkout work && git rebase master && git checkout master && git merge work && git svn dcommit && git svn rebase && git checkout work && git rebase master
[alias]
spull = !git checkout master && git svn rebase
spush = !git checkout master && git svn dcommit
work = !git checkout work && git rebase master
prepwork = !git checkout work && git rebase master && git checkout master && git merge work
@ferventcoder
ferventcoder / S3Backup.ps1
Created December 12, 2012 15:23
S3 Backup using CloudBerry's snapin
$bucket = 'somebucket'
$bucketSubFolder = 'subfolderkey'
$s3AccessKey = $env:AWS_S3__AccessKey
$s3Secret = $env:AWS_S3_Secret
$destinationFolder = "$bucket/$bucketSubFolder"
$localFolder = "C:\Users\user\somefolder"
#http://www.cloudberrylab.com/default.aspx?page=amazon-s3-powershell
Add-PSsnapin cloudberrylab.explorer.pssnapin
Say you are in a world where you want to use progressive enhancement (sometimes for accessibility)
with ASP.NET MVC 3+.
Progressive Enhancement means the site WORKS WITHOUT JAVASCRIPT FOLKS.
Now say you have something like comments that will be on multiple pages.
You want the site to be maintainable so you want to use a partial with
form submission.
Rebasing is another way to interact with a remote repository.
What it does is take your changes, not yet on the remote, and pulls them off to the side.
Then it puts all of the changes in the remote on your repository. After that it puts
your changes after the changes from the remote.
This results in less merge errors because you are putting your work at the end.
What does it look like?
git fetch