Skip to content

Instantly share code, notes, and snippets.

@laribee
laribee / Example.feature
Created November 6, 2017 20:24
Test-per-scenario with SpecFlow
Feature: Example
Can we bypass step definitions and use a single test
fixture instead? Yes we can!
Scenario: Spike
Now I can explain my scenario and examples
outside of the somewhat restrictive GWT-type
language.
using System;
using NSubstitute;
using Xunit;
namespace tdd_mvvm
{
public class LoginPresenterTests
{
[Fact]
public void SubscribeToViewsLoginSubmit()
@laribee
laribee / customize.sh
Created March 12, 2017 06:51
Customize Git
#!/bin/bash
git config --global alias.lg \
”log --color --graph \
--pretty=format:’%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit”
git lg
git lg -p
git clone https://github.com/nerdnoir/dockerize-node.git
#!groovy
/*
The MIT License
Copyright (c) 2015-, CloudBees, Inc., and a number of other of contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@laribee
laribee / docker-compose.yml
Created March 12, 2017 02:09
Drone + Gogs Docker Compose File
gogs:
image: gogs/gogs:latest
ports:
- "10021:3000"
- "10022:22"
volumes:
- ./data:/data
drone:
image: drone/drone:0.4
ports:
public string WhatsWrongWithThisMethod(string something)
{
_state.Set(something);
return _internalState;
}
@laribee
laribee / gist:5760490
Last active December 18, 2015 09:19
bowlin'
using System.Collections;
using System.Collections.Generic;
using MbUnit.Framework;
namespace specs_for_bowling
{
[TestFixture]
public class when_everything_is_wired_up
{
SELECT TOP (100) PERCENT dbo.Forum.ID AS ForumID
, I.ID AS IdeaID
, (SELECT COUNT(*) FROM dbo.Vote WHERE (Idea_id = I.ID)) AS VoteCount
, (SELECT COUNT(*) FROM dbo.Comment WHERE (Idea_id = I.ID)) AS CommentCount
FROM dbo.Idea AS I
INNER JOIN dbo.Category ON I.Category_id = dbo.Category.ID
INNER JOIN dbo.Forum ON dbo.Category.Forum_id = dbo.Forum.ID
GROUP BY I.ID, dbo.Forum.ID
ORDER BY ForumID, IdeaID
@laribee
laribee / Ubiquitron.md
Created July 10, 2012 04:34
Ubiquitous Language

The Ubiquitous Language

We want to live our domain. We want to eat it, to consume it. Most of all, we want to share this language from user to code.

This is the ubiquitous language.

It is free from ambiguity. We talk about these things. In our codebase, we find classes and objects named after these things. The ubiquitous language, the language we all use, eliminates impedance... it puts us all on the same key... it is all how we get along

You, Ubiquitron

# OK
def dilettante
content = []
other_extended_fields_element.div_elements(:class => 'text').each do |c|
content << c.label.text
end
content
end
# BETTER!