Skip to content

Instantly share code, notes, and snippets.

View brendanjerwin's full-sized avatar

Brendan Erwin brendanjerwin

View GitHub Profile
<link rel="openid.server" href="https://www.myopenid.com/server/" />
<link rel="openid.delegate" href="https://brendanjerwin.myopenid.com/" />
Given("I live at ([/d]5)", (zip)=>
{
});
Given("I live at ([/d]5)", (city, state, zip) =>
{
});
10 Reasons You Might Be Writing Coyote Code
Rob Conery 9/21/09 11:11 PM Rob Conery Opinion
Sometimes I find myself writing code for an application or a project that I just don’t want to write. I’m just not into it – and try as I might I sometimes end up writing funky junk that looks like … VB.
People react differently in these situations – some get depressed, others play video games and maybe drink a few more beers than they should and write cranky blog posts. Some even do all three…
Whatever the reason – you owe it to yourself to make sure you’re still in the game and don’t let it go too far or you’ll burn up completely. The last thing you want to do is blow up a client’s application and screw your employer and yourself at the same time simply because you can’t identify a bad situation for yourself.
@brendanjerwin
brendanjerwin / IViewPage.cs
Created February 10, 2010 14:57
A Nice Way to Provide View Helpers for Site Infrastructure
namespace HomeStudyNow.Infrastructure.ViewPages
{
public interface IViewPage
{
bool Authenticated { get; }
string UserName { get; }
bool HasFlash { get; }
bool FlashError { get; }
string Flash { get; }
string E(string value);
public static Boolean IsDirtyEntity(this ISession session, Object entity)
{
return (DirtyPropertiesOf(session, entity).Any());
}
public static IEnumerable<string> DirtyPropertiesOf(this ISession session, Object entity)
{
String className = NHibernateProxyHelper.GuessClass(entity).FullName;
ISessionImplementor sessionImpl = session.GetSessionImplementation();
@brendanjerwin
brendanjerwin / dot_net_release_tasks.rb
Created March 6, 2010 23:59
release tasks for my .net projects
require 'rubygems'
require 'albacore'
require 'net/github-upload'
login = `git config github.user`.chomp # your login for github
token = `git config github.token`.chomp # your token for github
repo = $1 if repo.nil? && `git remote show origin` =~ /[email protected]:(.+?)\.git/
repo.chomp!
@brendanjerwin
brendanjerwin / gist:889471
Created March 27, 2011 18:57
temp hal component
#!/usr/bin/env python
# encoding: utf-8
"""
Created by Brendan Erwin on 2008-05-21.
Copyright (c) 2008 Brendan Erwin. All rights reserved.
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.
@brendanjerwin
brendanjerwin / gist:910662
Created April 8, 2011 20:31
How do I write this in coffeescript?
expect(function() {
player.resume();
}).toThrow("song is already playing");
@brendanjerwin
brendanjerwin / accessorize.coffee
Created May 25, 2011 02:42
Critique my Coffeescript
###
_Add observable accessors to any object._
`accessorize.js` makes it easy to convert plain javascript 'properties'
into fancy-ass-observable-accessor-methods!
See [accessorizejs.com](http://accessorizejs.com) for more info and license information.
###
UNDERSCORE_PATH = "lib/underscore"
@brendanjerwin
brendanjerwin / writer
Created May 28, 2011 00:45
open iA writer from the command line
#! /bin/bash
open $1 -a /Applications/iA\ Writer.app