Skip to content

Instantly share code, notes, and snippets.

Viktor Farcic vfarcic

Block or report user

Report or block vfarcic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View frontEnd.tmpl.html
<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.spec.js
Created Oct 7, 2014
Mars Rover kata in JavaScript: tests
View MarsRover.spec.js
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 / MarsRover.js
Created Oct 7, 2014
Mars Rover kata in JavaScript: implementation
View MarsRover.js
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 / RoverSpec.java
Created Oct 16, 2014
Mars Rover kata spec
View RoverSpec.java
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 Oct 16, 2014
Mars Rover kata solution
View Rover.java
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;
View GroupingSpec.java
package com.technologyconversations.java8exercises.streams;
import org.junit.Test;
import java.util.List;
import java.util.Map;
import static com.technologyconversations.java8exercises.streams.Grouping.*;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
View Grouping.java
package com.technologyconversations.java8exercises.streams;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static java.util.stream.Collectors.*;
public class Grouping {
View ToUpperCaseSpec.java
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;
View JoiningSpec.java
package com.technologyconversations.java8exercises.streams;
import org.junit.Test;
import java.util.List;
import static com.technologyconversations.java8exercises.streams.Joining.namesToString;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
View Joining.java
package com.technologyconversations.java8exercises.streams;
import java.util.List;
import static java.util.stream.Collectors.joining;
public class Joining {
public static String namesToString7(List<Person> people) {
String label = "Names: ";
You can’t perform that action at this time.