Skip to content

Instantly share code, notes, and snippets.

View UberMouse's full-sized avatar

Taylor Lodge UberMouse

View GitHub Profile
package rover
/**
* Created by wyntl1 on 18/03/14.
*/
class TurnDirection
case class Left() extends TurnDirection
case class Right() extends TurnDirection
abstract class Direction() {
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
@UberMouse
UberMouse / gist:43abf82f7c4c7b4c4d06
Last active August 29, 2015 14:05
Scala Palindromes
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
})
@UberMouse
UberMouse / gist:cca6f6e453f5c2337c41
Created September 9, 2014 12:40
Adds items to your countdown online shopping cart
[
//[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});
}
# 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
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")
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
// 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',
@UberMouse
UberMouse / gist:88f43ddd74e0de4bd226
Created May 23, 2015 10:21
Play/Pause Google Music from my Pendulumic Stance S1+
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)
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'
],