Skip to content

Instantly share code, notes, and snippets.

View alexo's full-sized avatar

Alex Objelean alexo

View GitHub Profile
val romanNumeral = Map(1 -> "I", 2 -> "II", 3 -> "III", 4 -> "IV", 5 -> "V")
println(romanNumeral(4))
val treasureMap = new HashMap[Int, String]
treasureMap += 1 -> "Go to island."
treasureMap += 2 -> "Find big X on ground."
treasureMap += 3 -> "Dig."
println(treasureMap(2))
Collections.sort(people, new Comparator<Person>() {
public int compare(Person a, Person b) {
return a.getName().compare(b.getName());
}
});
Collections.sort(people, new Comparator<Person>() {
public int compare(Person a, Person b) {
return Integer.valueOf(a.getAge()).compare(b.getAge());
}
});
public class Person {
public final String name;
public final int age;
Person(final String name, final int age) {
this.name = name;
this.age = age;
}
}
META-INF/services/com.betfair.mock.MockCASService
public MockCASService implements CASService {
}
public class FirstController {
@Mockable(defaultMockImplementation = DefaultMockImplementation.ALWAYS_THROWS_EXCEPTION)
private CASService casService;
}
public class MyController {
@Mockable
private CASService casService;
}
<dependency>
<groupId>com.betfair.libraries.mockable</groupId>
<artifactId>mockable-core</artifactId>
</dependency>
@alexo
alexo / pr.md
Created August 14, 2012 07:49 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@alexo
alexo / notes.markdown
Created January 10, 2012 20:19 — forked from matthewmccullough/notes.markdown
January GitHub Git Foundations Class Notes

January GitHub Git Foundations Class Notes

How did you do that init again?

git init project2
cd project2
git status
mate index.html
git status