Skip to content

Instantly share code, notes, and snippets.

View vfarcic's full-sized avatar

Viktor Farcic vfarcic

View GitHub Profile
@vfarcic
vfarcic / frontEnd.tmpl.html
Created July 7, 2014 14:10
bootstrap-nav
<div class="col-md-3">
<ul class="nav nav-pills nav-stacked">
<li><a href="/page/static/responsiveGrid">Multichannel</a></li>
<li><a href="/page/static/navigation">Navigation</a></li>
<li><a href="/page/static/staticScreen">Static Screens</a></li>
</ul>
</div>
@vfarcic
vfarcic / MarsRover.js
Created October 7, 2014 12:26
Mars Rover kata in JavaScript: implementation
function MarsRover(location, direction, grid, obstacles) {
self = this;
this.location = (location === undefined) ? [0, 0] : location;
this.direction = (direction === undefined) ? 'N' : direction;
this.grid = (grid === undefined) ? [100, 100] : grid;
this.obstacles = (obstacles === undefined) ? [] : obstacles;
this.status = 'OK';
this.commands = function(commands) {
@vfarcic
vfarcic / MarsRover.spec.js
Created October 7, 2014 12:28
Mars Rover kata in JavaScript: tests
describe('Mars Rover', function() {
describe('You are given the initial starting point (x,y) of a rover and the direction (N,S,E,W) it is facing', function() {
it('should set starting location', function() {
var mr = new MarsRover([12, 21]);
expect(mr.location).toEqual([12, 21]);
});
it('should use default starting location value 0x0 when not assigned', function() {
var mr = new MarsRover();
expect(mr.location).toEqual([0, 0]);
@vfarcic
vfarcic / RoverSpec.java
Created October 16, 2014 13:14
Mars Rover kata spec
package com.technologyconversations.kata.marsrover;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static org.assertj.core.api.Assertions.*;
@vfarcic
vfarcic / Rover.java
Created October 16, 2014 13:18
Mars Rover kata solution
package com.technologyconversations.kata.marsrover;
/*
Method receiveCommands should be used to transmit commands to the rover.
*/
public class Rover {
private Coordinates coordinates;
public void setCoordinates(Coordinates value) {
coordinates = value;
package com.technologyconversations.java8exercises.streams;
import org.junit.Test;
import java.util.List;
import static com.technologyconversations.java8exercises.streams.ToUpperCase.*;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
package com.technologyconversations.java8exercises.streams;
import java.util.ArrayList;
import java.util.List;
import static java.util.stream.Collectors.toList;
public class ToUpperCase {
public static List<String> transform7(List<String> collection) {
package com.technologyconversations.java8exercises.streams;
import org.junit.Test;
import java.util.List;
import static com.technologyconversations.java8exercises.streams.FilterCollection.*;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
package com.technologyconversations.java8exercises.streams;
import java.util.ArrayList;
import java.util.List;
import static java.util.stream.Collectors.toList;
public class FilterCollection {
public static List<String> transform7(List<String> collection) {
package com.technologyconversations.java8exercises.streams;
import org.junit.Test;
import java.util.List;
import static com.technologyconversations.java8exercises.streams.FlatCollection.*;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;