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
package rover | |
/** | |
* Created by wyntl1 on 18/03/14. | |
*/ | |
class TurnDirection | |
case class Left() extends TurnDirection | |
case class Right() extends TurnDirection | |
abstract class Direction() { |
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
lines = [] | |
File.open(ARGV[0]).each_line do |line| | |
lines << line | |
end | |
def word_to_num(word) | |
case word | |
when "zero" then 0 | |
when "one" then 1 | |
when "two" then 2 |
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
def isPalindromeReversing(str: String): Boolean = str.reverse == str | |
def isPalindrome(str: String) = { | |
val half = str.length / 2 | |
val firstHalf = str.take(half) | |
val secondHalf = str.drop({ | |
if(str.length % 2 != 0) | |
half + 1 | |
else | |
half | |
}) |
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
[ | |
//[stock_code, quantity] | |
].forEach(function(product) { | |
var stock_code = product[0], quantity = product [1]; | |
$.post('/Shop/AddToTrolley', {quantity: quantity, stockcode: stock_code}, function(data, status) { | |
if(status === "success") console.log(stock_code + " (" + quantity + ") succeeded"); | |
else { | |
console.log(stock_code + " failed"); | |
console.log({resp: data}); | |
} |
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
# If you're using antigen, run the following line to apply the theme. Add it to your zshrc if you want it to be permanent. | |
# antigen theme https://gist.github.com/Widdershin/a080ec7a6af0f943f40f agnoster | |
# vim:ft=zsh ts=2 sw=2 sts=2 | |
# | |
# agnoster's Theme - https://gist.github.com/3712874 | |
# A Powerline-inspired theme for ZSH | |
# | |
# # README | |
# | |
# In order for this theme to render correctly, you will need a |
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 java.io.InputStream | |
import java.io.FileInputStream | |
object Main { | |
implicit def streamToPimpedStream(stream: InputStream) = new PimpedInputStream(stream) | |
def main(args: Array[String]) { | |
def master = new FileInputStream("C:\\test1.txt") | |
val identical = new FileInputStream("C:\\test2.txt") | |
val modified = new FileInputStream("C:\\test3.txt") |
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
VIRTUAL_ENV_DISABLE_PROMPT=true | |
# PROMPT | |
if [ ! -n "${WILDCHERRY_PROMPT_CHAR+1}" ]; then | |
WILDCHERRY_PROMPT_CHAR="\$" | |
fi | |
if [ ! -n "${WILDCHERRY_PROMPT_ROOT+1}" ]; then | |
WILDCHERRY_PROMPT_ROOT=true | |
fi |
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
// Karma configuration | |
// Generated on Fri May 08 2015 13:51:33 GMT+1200 (NZST) | |
module.exports = function(config) { | |
config.set({ | |
basePath: '', | |
plugins: [ | |
'karma-babel-preprocessor', | |
'karma-mocha', | |
'karma-chrome-launcher', |
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
AHKHID_UseConstants() | |
;Create GUI to receive messages | |
Gui, +LastFound | |
hGui := WinExist() | |
;Intercept WM_INPUT messages | |
WM_INPUT := 0x00FF | |
OnMessage(WM_INPUT, "InputMsg") | |
;Register Remote Control with RIDEV_INPUTSINK (so that data is received even in the background) |
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
var path = require('path'); | |
var webpack = require('webpack'); | |
var foundationRoot = path.join(__dirname, 'bower_components', 'foundation', 'scss') | |
module.exports = { | |
devtool: 'source-map', | |
entry: [ | |
'webpack-hot-middleware/client', | |
'./src/index' | |
], |