Skip to content

Instantly share code, notes, and snippets.

Matt Kocaj cottsak

Block or report user

Report or block cottsak

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cottsak
cottsak / .gitconfig
Last active Jul 31, 2018
some useful git alias commands
View .gitconfig
[alias]
st = status # press less keys and live longer
co = checkout
ac = !git add . && git commit -am # add everything, commit and supply message
fukd = !git reset --hard && git checkout . && git clean -df # nuke the working directory. I just want to start again
coto = branch --sort=-committerdate # I want to change branches, which are my recent ones again?
oc = commit -a --amend -C HEAD # I just fixed a small thing that should be in my last commit
git = !exec git
View keys.h
const char* wifiCreds[] = { "your wifi ssid", "your wifi password" };
String iftttMakerUrl = "https://maker.ifttt.com/trigger/esp_message/with/key/your-token";
View keybase.md

Keybase proof

I hereby claim:

  • I am cottsak on github.
  • I am mattkocaj (https://keybase.io/mattkocaj) on keybase.
  • I have a public key ASDknYaagFEAuOg5n754B794BqQ29_RN3UnagENwBWYs1go

To claim this, I am signing this object:

@cottsak
cottsak / 1-rego.cs
Last active Aug 29, 2015
Explicitly flushing NHibernate ISession at the end of every request
View 1-rego.cs
class WebRegistrationModule : Module
{
protected override void Load(ContainerBuilder builder)
{
builder.RegisterControllers(ThisAssembly);
builder.RegisterModule(new AutofacWebTypesModule());
RegisterDatabaseComponents(builder);
}
View gist:6b21b2e91efb01755dc5
public class controllers_should
{
[Fact]
public void derive_from_from_our_base()
{
foreach (var controller in GetControllersThatDontNeedAuth())
{
var authenticatedControllerType = typeof(AuthenticatedController);
Assert.True(controller.IsSubclassOf(authenticatedControllerType),string.Format("{0} should derive from {1}", controller.Name, authenticatedControllerType.Name));
//controller.IsSubclassOf(authenticatedControllerType).ShouldBe(true); // the message from this line isn't very helpful
You can’t perform that action at this time.