Skip to content

Instantly share code, notes, and snippets.

View dblevins's full-sized avatar

David Blevins dblevins

View GitHub Profile
#!/bin/bash
STRING=$(echo -n "(request-target): get /signature-prototype-1.0-SNAPSHOT/api/colors/preferred
date: Tue, 07 Jun 2014 20:51:35 GMT" | base64)
SIGNATURE=$(
echo -n "(request-target): get /signature-prototype-1.0-SNAPSHOT/api/colors/preferred
date: Tue, 07 Jun 2014 20:51:35 GMT" | openssl dgst -binary -sha256 -hmac "PennyLunaLuka" | base64)
package localdomain.localhost;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
@dblevins
dblevins / PerformaApiApplication.java
Created June 27, 2012 17:00
JAX-RS ServiceLoader - JS
@ApplicationPath("api")
public class PerformaApiApplication extends Application {
@Override
public Set<Class<?>> getClasses() {
final ClassLoader loader = this.getClass().getClassLoader();
final Set<Class<?>> services = new HashSet<Class<?>>();
for (String className : readClasses()) {
try {
final Class<?> clazz = loader.loadClass(className);