Skip to content

Instantly share code, notes, and snippets.

View JeremySkinner's full-sized avatar

Jeremy Skinner JeremySkinner

View GitHub Profile
# Takes a repository which has autocrlf set to true and changes it to false using powershell
# Turn autocrlf off
git config core.autocrlf false
# Remove all files
git rm --cached -r .
# Re-add all files
git diff --cached --name-only | foreach { git add $_ }
//global.asax
RouteTable.Routes.Add("ProductsRoute", new Route
(
"products/apparel",
new CustomRouteHandler("~/Products/ProductsByCategory.aspx",
"category=18")
));
In your ~/.gitconfig:
[color]
branch = auto
diff = auto
status = auto
In powershell profile:
var query = from c in linq.Customers
select c;
query = query.WithPath(path =>
path.Prefetch<Order>(c => c.Orders)
.SubPath(subpath => subpath.Prefetch(o => o.Product));
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<% int count = 0; %>
<% for (int i = 0; i < ((ICollection)Model).Count; i++) { %>
<input type="hidden" name="<%= ViewData.TemplateInfo.GetFullHtmlFieldName("") %>[<%= i %>]" />
<% } %>
<Database Name="Test" xmlns="http://schemas.microsoft.com/linqtosql/mapping/2007">
<Function Name="CustomersAndOrders" Method="CustomersAndOrders">
<ElementType Name="FluentLinqToSql.DatabaseTests.Entities.Customer" />
<ElementType Name="FluentLinqToSql.DatabaseTests.Entities.Order" />
</Function>
</Database>
This is in my %userprofile%/.gitconfig
[alias]
cia = !git add -A && git commit
$files = dir -recurse | where { $_.PSIsContainer -eq $false -and (get-content($_.FullName)).Length -gt 1000 }
$count = $files.Count
//Query is marked as cacheable, but the query cache is never used.
var rooms = session.CreateQuery("from Room order by Name")
.SetCacheable(true)
.List<Room>();
@JeremySkinner
JeremySkinner / download-latest-nhprof.ps1
Created January 27, 2010 16:13
Download latest NHProf usng Powershell
# Script to download the latest NHprof build
# Note that this script requires the 7zip command line (http://www.7-zip.org/)
#configuration
$installDir = "C:\Projects\tools\nhprof"
$downloadDir = "C:\Temp\Nhprof"
$7zipexe = "C:\Program Files\7-Zip\7z.exe"
$url = "http://builds.hibernatingrhinos.com/downloadLatest/nhprof"
$file = "$downloadDir\NHProf.zip"