Skip to content

Instantly share code, notes, and snippets.

View kevana's full-sized avatar

Kevan Ahlquist kevana

View GitHub Profile
@kevana
kevana / mmmmCookies.hbs
Last active May 28, 2019 10:30
Part of Nginx config for cookie-based routing.
if ($http_cookie ~* (
{{~#each cookies~}}
{{~ this }}{{#unless @last}}|{{/unless}}
{{~/each~}}
)=Y) {
rewrite ^{{ ocpUrl }}$ {{ bcpUrl }} redirect;
}
if ($http_cookie !~* (
{{~#each cookies~}}
{{~ this }}{{#unless @last}}|{{/unless}}
@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;
@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
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 / 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
@kevana
kevana / books.md
Last active October 13, 2016 05:30
Books I've already read
  • Laws of Simplicity
  • Designing for Emotion
  • The Age of the Platform
  • Design of Everyday Things
  • Release It!
  • Mythical Man Month
  • Peopleware
  • Inspired
  • Agile Project Management with Scrum
  • Distributed Systems, principles and paradigms
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 / 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.

@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 / 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!