Skip to content

Instantly share code, notes, and snippets.

View JeremySkinner's full-sized avatar

Jeremy Skinner JeremySkinner

View GitHub 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));
In your ~/.gitconfig:
[color]
branch = auto
diff = auto
status = auto
In powershell profile:
//global.asax
RouteTable.Routes.Add("ProductsRoute", new Route
(
"products/apparel",
new CustomRouteHandler("~/Products/ProductsByCategory.aspx",
"category=18")
));
# 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 $_ }
//Grid Model
public class MyGridModel : GridModel<Person> {
private HtmlHelper _html;
public MyGridModel() {
ColumnFor(x => _html.ActionLink("Whatever"));
}
public MyGridModel Build(HtmlHelper html) {
# First you'll need to download posh-hg from one of the following locations:
# http://github.com/JeremySkinner/posh-hg
# http://poshhg.codeplex.com
# Add the following code to your profile.ps1 (usually in C:\Users\User\Documents\WindowsPowershell)
# Import the posh-hg module from wherever it is saved
Import-Module "Path\To\posh-hg"
# Override the default prompt behaviour:
# My Mercurial/svn workflow using hgsubversion
# Get latest changes from svn:
hg pull --rebase
# hack away on some code...
# Commit to local hg repo
hg commit
# tpager.py - browse command output with an external pager using temp files
#
# Copyright 2008 David Soria Parra <dsp@php.net>
# Copyright 2010 Eduard STEFAN <alexandrul.ct@gmail.com>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
[defaults]
addremove = --similarity 80
glog = --style="C:/Documents/My Dropbox/Scripts/mercurial-cli-templates/map-cmdline.sglog"
push = --branch .
revert = --no-backup
log = --style="C:/Documents/My Dropbox/Scripts/mercurial-cli-templates/map-cmdline.slog"
attic-unshelve = --delete
# powershell script for syncing a mercurial repository with a git repository.
# Usage: HgSync.ps1 NameOfProject git://github.com/Path/To/RemoteGitRepo.git https://Path/To/RemoteHgRepository
# Requires the hg-git plugin http://hg-git.github.com/
$project = $args[0]
$gitrepo = $args[1]
$hgrepo = $args[2]
$path = "D:\hg-sync\$project"
function hg {