Skip to content

Instantly share code, notes, and snippets.

View jdaggett's full-sized avatar

Jeremy Daggett jdaggett

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jdaggett on github.
  • I am jdaggett (https://keybase.io/jdaggett) on keybase.
  • I have a public key whose fingerprint is DAFA B6FD 4249 78B8 688A 5BE6 D6B9 CFAB CCBF A8C1

To claim this, I am signing this object:

@jdaggett
jdaggett / CreateServiceOptions
Created February 16, 2015 17:30
CDN Options
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@jdaggett
jdaggett / gist:59c872c9dd7e88f08cbb
Created January 28, 2015 02:45
UpdateOptions with AutoBuilder
@AutoValue
public abstract static class UpdateOptions {
public abstract String getDomain();
public abstract String getProtocol();
@SerializedNames({ "domain", "protocol" })
public static UpdateOptions create(String domain, String protocol) {
return new AutoValue_Domain_UpdateOptions(domain, protocol);
}
@jdaggett
jdaggett / gist:65ce5ae22dcbe0d0dd67
Created October 17, 2014 01:00
Auth Token Insanity
X-Auth-Token: MIINVwYJKoZIhvcNAQcCoIINSDCCDUQCAQExCTAHBgUrDgMCGjCCC60GCSqGSIb3DQEHAaCCC54EgguaeyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAiMjAxNC0xMC0xNVQyMDowMjoyNC45NjM0OTIiLCAiZXhwaXJlcyI6ICIyMDE0LTEwLTE1VDIxOjAyOjI0WiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJ0ZW5hbnQiOiB7ImRlc2NyaXB0aW9uIjogIiIsICJlbmFibGVkIjogdHJ1ZSwgImlkIjogIjFhZDc2MTI2Y2M5YjRlMmFhYWU1YjVmZmJhNGYyYjU0IiwgIm5hbWUiOiAiUGVubnpvaWwifX0sICJzZXJ2aWNlQ2F0YWxvZyI6IFt7ImVuZHBvaW50cyI6IFt7ImFkbWluVVJMIjogImh0dHA6Ly8xMC42MC4yMDEuMTE6ODc3NC92Mi8xYWQ3NjEyNmNjOWI0ZTJhYWFlNWI1ZmZiYTRmMmI1NCIsICJyZWdpb24iOiAicmVnaW9uT25lIiwgImludGVybmFsVVJMIjogImh0dHA6Ly8xMC42MC4yMDEuMTE6ODc3NC92Mi8xYWQ3NjEyNmNjOWI0ZTJhYWFlNWI1ZmZiYTRmMmI1NCIsICJpZCI6ICIyYjcyODdiMTQ2ZGY0ZThkOTc0M2Y3Mzc3MDI3NGRlNCIsICJwdWJsaWNVUkwiOiAiaHR0cDovLzEwLjYwLjY2LjExOjg3NzQvdjIvMWFkNzYxMjZjYzliNGUyYWFhZTViNWZmYmE0ZjJiNTQifV0sICJlbmRwb2ludHNfbGlua3MiOiBbXSwgInR5cGUiOiAiY29tcHV0ZSIsICJuYW1lIjogIm5vdmEifSwgeyJlbmRwb2ludHMiOiBbeyJhZG1pblVSTCI6ICJodHRwOi8vMTAuNjAuMjAxLjExOjk2OTYvIiwgInJlZ2lvbiI6ICJyZWdpb2
@jdaggett
jdaggett / AutoStack.java
Created October 16, 2014 17:23
Heat AutoValue Prototype
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
testCreateWith408Retry(org.jclouds.openstack.swift.v1.features.ObjectApiMockTest) Time elapsed: 0.009 sec <<< FAILURE!
org.jclouds.http.HttpResponseException: request: PUT http://jd-mbp-9.local:52577/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/myContainer/myObject HTTP/1.1 failed with response: HTTP/1.1 408 OK
at org.jclouds.openstack.swift.v1.handlers.SwiftErrorHandler.handleError(SwiftErrorHandler.java:46)
at org.jclouds.http.handlers.DelegatingErrorHandler.handleError(DelegatingErrorHandler.java:67)
at org.jclouds.http.internal.BaseHttpCommandExecutorService.shouldContinue(BaseHttpCommandExecutorService.java:180)
at org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:150)
at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:93)
at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:76)
at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:47)
at org.jclouds.reflect.FunctionalRefle
@jdaggett
jdaggett / gist:10429758
Created April 10, 2014 22:44
Static Import
properties.setProperty(SERVICE_TYPE, QUEUES);
properties.setProperty(CREDENTIAL_TYPE, PASSWORD_CREDENTIALS);
properties.setProperty(SERVICE_TYPE, ServiceTypes.QUEUES);
properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS);
@jdaggett
jdaggett / jclouds.log
Created March 4, 2014 22:09
Rackspace CloudFiles UK Provider Live Tests
➜ rackspace-cloudfiles-uk git:(cloudfiles-uk) ✗ mvn -Plive clean install -Dtest.rackspace-uk.identity=<username> -Dtest.rackspace-uk.credential=<apiKey> -Drat.numUnapprovedLicenses=100
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.apache.jclouds.labs:rackspace-cloudfiles-uk:bundle:1.8.0-SNAPSHOT
[WARNING] 'parent.relativePath' points at org.apache.jclouds.labs:jclouds-labs-openstack instead of org.apache.jclouds:jclouds-project, please verify your project structure @ line 22, column 11
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
@jdaggett
jdaggett / gist:9104143
Last active August 29, 2015 13:56
Swift Static Large Object Ideas
// Current API to determine if an object is the manifest
SwiftObject obj = api.get("myObject", GetOptions.NONE).headers().containsKey("X-Static-Large-Object");
// The following isn't ideal because Swift extends itself via headers... kinda yucky
SwiftObject obj = api.get("myObject", GetOptions.NONE).isManifestObject();
// or maybe put this in a SwiftUtils class???
SwiftUtils.isManifestObject(obj)