Skip to content

Instantly share code, notes, and snippets.

View JeremySkinner's full-sized avatar

Jeremy Skinner JeremySkinner

View GitHub Profile
public ActionResult Sorting(GridSortOptions sort)
{
// If there's no sort option specifed, then default to sorting on the Name column.
if(string.IsNullOrEmpty(sort.Column)) {
sort = new GridSortOptions { Column = "Name" };
}
ViewData["sort"] = sort;
before_each {
write-host "I will be written before each test is run"
}
when "True is true" {
assert { $true -eq $true }
}
when "True is false, the world may explode" {
assert { $true -eq $false } "True should be false"
@Html.Grid(Model).Columns(column => {
column.Custom(
@<div>
<em>Hello there</em>
<strong>@item.Name</strong>
</div>
).Named("Custom Column");
})
public abstract class StepBase<T,TProperty, TSelf> : IConfigurable<PropertyRule<T>, TSelf> where TSelf : StepBase<T, TProperty, TSelf> {
...
}
# 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 {
[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
# tpager.py - browse command output with an external pager using temp files
#
# Copyright 2008 David Soria Parra <[email protected]>
# Copyright 2010 Eduard STEFAN <[email protected]>
#
# 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.
#
# 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
# 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:
//Grid Model
public class MyGridModel : GridModel<Person> {
private HtmlHelper _html;
public MyGridModel() {
ColumnFor(x => _html.ActionLink("Whatever"));
}
public MyGridModel Build(HtmlHelper html) {