Skip to content

Instantly share code, notes, and snippets.

@cottsak
cottsak / .gitconfig
Last active June 2, 2020 06:32
some useful git alias commands
[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
const char* wifiCreds[] = { "your wifi ssid", "your wifi password" };
String iftttMakerUrl = "https://maker.ifttt.com/trigger/esp_message/with/key/your-token";

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 August 29, 2015 14:11
Explicitly flushing NHibernate ISession at the end of every request
class WebRegistrationModule : Module
{
protected override void Load(ContainerBuilder builder)
{
builder.RegisterControllers(ThisAssembly);
builder.RegisterModule(new AutofacWebTypesModule());
RegisterDatabaseComponents(builder);
}
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