This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.annotation.tailrec | |
// A lil class to make the code neater | |
case class Coordinate(x: Int, y: Int) | |
@tailrec | |
def diagonal(matrix: List[List[Int]], coordinate: Coordinate, previousPath: List[Int] = List.empty) | |
: List[Int] = { | |
val path = previousPath :+ matrix(coordinate.y)(coordinate.x) | |
val nextCoordinates = Coordinate(coordinate.x + 1, coordinate.y + 1) |
I hereby claim:
- I am kittsville on github.
- I am kittsville (https://keybase.io/kittsville) on keybase.
- I have a public key ASB7KhYSlXYY5zC0yRzP974SMF5kdkixYlBsjOqqFLwHlgo
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To run tests in test suite with exact same name | |
testOnly uk.sci1.foo.FooTestSuiteSpec -- -t "Name of my specific test" | |
# Alternatively | |
testOnly *FooTestSuiteSpec -- -t "Name of my specific test" | |
# To run tests in suite with substring "Bar" | |
testOnly uk.sci1.foo.FooTestSuiteSpec -- -z "Bar" | |
# To re-run the tests on every file change | |
~ testOnly [your query here] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'body': | |
'ctrl-tab ^ctrl': 'unset!' | |
'ctrl-tab': 'pane:show-next-item' | |
'ctrl-shift-tab ^ctrl': 'unset!' | |
'ctrl-shift-tab': 'pane:show-previous-item' | |
'ctrl-alt-s': 'window:save-all' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Random Serializable | |
* @author Kit Maywood | |
* @licence WTFPL | |
* @version 1.0 | |
* | |
* Generates a random serializable value such as a string, boolean or array. | |
* Arrays themselves contain random serializable values | |
* I realised how stupid this was but decided to finish it anyway |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName sitename.localhost | |
ServerAlias www.sitename.localhost | |
DocumentRoot C:/xampp/apps/sitename/htdocs | |
<Directory "C:/xampp/apps/sitename/htdocs"> | |
Options -MultiViews +FollowSymLinks | |
AllowOverride All | |
Require all granted | |
</Directory> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Bulk Flair Upload | |
* Version 0.1 | |
* Author: @kittsville | |
* Allows bulk adding of user flair templates from a text file | |
* Only supports flair name, not CSS class | |
*/ | |
if (!window.FileReader || ![].forEach) { | |
throw "Your browser sucks so this won't work"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* git wipe | |
* Removes all uncommitted changes and untracked files/folders | |
*/ | |
git config --global alias.wipe '!git reset --hard && git clean -fd' | |
/** | |
* git undo | |
* Removes the last commit but leaves all its changes. | |
* Really useful if you fuck-up the commit message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ## HELPERS ## | |
-- General purpose functions used in multiple answers to avoid duplicate code | |
-- 1. count | |
-- Counts occurrences of given input in given list of inputs. | |
-- | |
-- Preconditions: | |
-- List must be finite | |
count :: (Eq a) => [a] -> a -> Int |
NewerOlder