Skip to content

Instantly share code, notes, and snippets.

View stevenharman's full-sized avatar

Steven Harman stevenharman

View GitHub Profile
$("#my_list").jqGrid({
datatype: 'json',
mtype: 'POST',
// configure colums, etc...
prmNames: { sort: "sortby", order: "sortorder" },
sortname: 'id',
sortorder: "desc"
});
git config --global diff.tool bc3
git config --global difftool.bc3.cmd "\"c:/program files (x86)/beyond compare 3/bcomp.exe\" \"\$LOCAL\" \"\$REMOTE\""
git config --global difftool.prompt false
git config --global merge.tool bc3
git config --global mergetool.bc3.cmd "\"c:/program files (x86)/beyond compare 3/bcomp.exe\" \"\$LOCAL\" \"\$REMOTE\" \"\$BASE\" \"\$MERGED\""
git config --global mergetool.bc3.trustExitCode true
$ git svn dcommit
Committing to svn://svnserver/1/ProductFoo/Trunk ...
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.8/msys/SVN/Core.pm line 579.
Authorization failed: at C:\Program Files (x86)\Git/libexec/git-core/git-svn line 3945
desc "Run a sample NCover Console code coverage"
ncoverconsoletask do |ncc|
ncc.path_to_command = "Tools/NCover-v3.2/NCover.Console.exe"
ncc.output = {:xml => "CodeCoverage/test-coverage.xml"}
ncc.no_registration # what makes sense here?
# other conf stuff...
end
public class MyViewModel
{
// other crap...
public string to_metadata()
{
var jq_meta = new
{
required = IsRequired,
messages = new { required = "gimme one, yo!"}
# interpret wtf this is trying to do
if (box.width < screen_width)
box.width = screen_width
# or express the intent straight away
box.width = [box.width, screen_width].max
public class when_creating_a_new_pie : concerns
{
private ViewResultBase _result;
protected override void context()
{
var controller = new PieController();
_result = controller.Create(new CreatePieCommand()) as ViewResultBase;
}
public class when_creating_a_doodad
{
private dynamic _result;
protected override void context()
{
var controller = new DoodadController();
// create action returns a JsonResult w/the an Anonymous object containing the associated Thingy's Id.
_result = controller.Create(new DoodadCreateCommand { title = "i'm new!" });
}
@stevenharman
stevenharman / install-windows-gems
Created June 17, 2010 21:18
Ruby Gems for Windows
# a whole bunch of gems that are useful for running the Rubies on Windoze
gem install win32-api win32-clipboard win32-dir win32-eventlog win32-file win32-file-stat win32-changejournal win32-process win32-sapi win32-service win32-sound win32console windows-api windows-pr wirble
For<UrlHelper>()
.HybridHttpOrThreadLocalScoped()
.Use(ctx =>
{
var httpContext = new HttpContextWrapper(HttpContext.Current);
var routeData = RouteTable.Routes.GetRouteData(httpContext);
return new UrlHelper(new RequestContext(httpContext, routeData));
});
For<IUrlHelper>()