Skip to content

Instantly share code, notes, and snippets.

@ihr
ihr / gist:ca634622381bababa319
Created February 25, 2016 09:18
jbehave - etsy example
@Given("I am on etsy.com")
public void homepageOnEtsyDotCom() {
home.go();
}
@When("I want to browse through a treasury gallery")
@Composite(steps = {
"When I want to buy something from etsy.com",
"When I want to browse the treasury",
"When I choose the first treasury gallery" })
public void browseToFirstTreasuryGallery() {
@ihr
ihr / JacksonTest.java
Created November 19, 2012 20:07
Jackson Databind NPE show case
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.hamcrest.core.IsEqual;
import org.junit.Assert;
import org.junit.Test;
import java.io.IOException;
@ihr
ihr / backbone.paginator.clientPager.sort.example
Created October 29, 2012 10:48
Second sort criterion for a backbone.paginator.clientPager
_sort: function ( models, sort, direction ) {
               models = models.sort(function (a, b) {
                   var ac = a.get(sort),
                       bc = b.get(sort);
                   if ( !ac || !bc ) {
                       return 0;
                   } else {
                       ac = ac.toString().toLowerCase();
                       bc = bc.toString().toLowerCase();