Skip to content

Instantly share code, notes, and snippets.

View camilleriluke's full-sized avatar
🐢

Luke Camilleri camilleriluke

🐢
View GitHub Profile
@camilleriluke
camilleriluke / DBConnection.java
Created October 20, 2014 17:25
Unit Testing Workshop Exercises Interfaces
public interface DBConnection {
/**
* Commits a student to this connection.
*
* @param student the student to be committed.
* @return <code>0</code> if committed successfully, <code>-1</code> otherwise.
*/
int commitStudent(Student student);
}
@camilleriluke
camilleriluke / yesno.js
Created November 15, 2013 10:29
The answer to all life decisions.
((~~(Math.random()*10))%2 ? "Yes" :"No don't") + " do it!"
@camilleriluke
camilleriluke / fib-js.js
Last active December 26, 2015 05:09
Fibonacci Sequence using JavaScript Arrays
function fibonacci(n) {
return Array.apply(0, new Array(n)).reduce(function(seq, current, index) {
return seq.concat((index < 2) ? index : seq[index-1] + seq[index-2]);
}, []);
}