Skip to content

Instantly share code, notes, and snippets.

View kevana's full-sized avatar

Kevan Ahlquist kevana

View GitHub Profile
@kevana
kevana / bot.py
Created March 24, 2014 08:54
A quick and dirty script that monitors reddit's newest comments and searches for a particular substring in each comment.
# New comment monitor for reddit
#
# Copyright (C) 2014 Kevan Ahlquist
#
import requests
import json
import pprint
from time import sleep
@kevana
kevana / sudokuSolver.scm
Created March 27, 2014 04:17
A throwback from my first semester in college.
(#%require racket/date)
;KEVAN AHLQUIST
;first test list
(define test '((9 . 3)(4 . 5)
(3 . 10)(2 . 13)(1 . 14)(9 . 18)
(1 . 20)(6 . 22)(9 . 24)
(6 . 28)(2 . 30)(9 . 34)(3 . 35)
(7 . 37)(9 . 41)(8 . 44)
(1 . 46)(4 . 48)(6 . 52)(7 . 53)
@kevana
kevana / DCI data.md
Last active August 29, 2015 14:02
This is the current progress of a project to compile corps and event information from Drum Corps International (DCI) for all years from 1972 to the present.

DCI event results!

@kevana
kevana / carriers_list.py
Created June 8, 2014 02:17
A python dictionary containing cell carrier email-to-SMS gateways
'''
Cell carrier email-to-SMS gateway information.
Numbers should contain no dashes or other punctuation.
Country codes may be required for some carriers.
example address format:
'5551112222@message.alltel.com'
This list was originally from the github.com/brendanlim/sms-fu project.
@kevana
kevana / something.md
Last active August 29, 2015 14:06
What I'm up to

What am I doing?

If we haven't caught up in a while, this is what I'm up to these days:

Working

I am a Software Engineer at Bluestem Brands (Fingerhut, eCommerce). I started with the web self service product team, we work on user experiences like applying for credit, tracking orders, and scheduling payments. Now I've moved to the shop team, where we integrate recommendation engines as well as add features to search and product pages. I moonlight with the platform team using Docker to ease test environment pain.

I'm also doing some contract work with Xylo, a startup that's making a service to manage the daily activities of music programs. We are using my peculiar combination of music knowledge and software skills to enhance the experience for program directors and students.

String extractExpirationYear(String cardExpiration) {
String year = cardExpiration == null || cardExpiration.length() != 6 ? "" : cardExpiration.substring(2, 6);
if ("".equals(year)) {
year = cardExpiration == null || cardExpiration.length() != 4 ? "" : "20" + cardExpiration.substring(2, 4);
}
return year;
}
@kevana
kevana / Dockerfile
Last active August 29, 2015 14:22
One of the first Dockerfiles we wrote, don't do this.
FROM ubuntu:14.04
MAINTAINER ***********
#Update package respository
RUN echo "deb http://dk.archive.ubuntu.com/ubuntu/ precise-security main universe" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y python-software-properties
RUN apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:webupd8team/java
docker run -d -p 9000:9000 -v /var/run/docker.sock:/docker.sock --name dockerui dockerui -e /docker.sock
c8267fd57f1cfa180c86d53ae229bc57e2a76cdff978726c3a287a340cd92f9b
Error response from daemon: Cannot start container c8267fd57f1cfa180c86d53ae229bc57e2a76cdff978726c3a287a340cd92f9b: failed sandbox add: failed to add interface veth1c3efdc to sandbox: failed in prefunc: failed to get link by name "veth1c3efdc": Link not found
make: *** [run] Error 1
@kevana
kevana / groovy.groovy
Last active September 16, 2015 23:33
@Unroll
def "kbaQuizAnswers is invalid when property #field of answer #ansNumber is null"() {
given:
command.kbaQuizAnswers.answers[ansNumber][field] = null
when:
def isValid = command.validate()
then:
!isValid
@kevana
kevana / es6-demo.js
Last active September 23, 2015 05:46
Short demo of useful ES6 features, for Babel REPL https://babeljs.io/repl/
// Based on https://medium.com/sons-of-javascript/javascript-an-introduction-to-es6-1819d0d89a0f
console.log('========== Block scope and arrow functions');
let square = x => x * x;
let add = (a, b) => a + b;
let pi = () => 3.1415;
console.log(square(5)); // 25
console.log(add(3, 4)); // 7
console.log(pi()); // 3.1415
var x = 0;