Skip to content

Instantly share code, notes, and snippets.

View stoicflame's full-sized avatar

Ryan Heaton stoicflame

  • Web Cohesion, LLC
  • Orem, UT
View GitHub Profile
diff --git a/enunciate.xml b/enunciate.xml
index 070bc89..db20f66 100644
--- a/enunciate.xml
+++ b/enunciate.xml
@@ -21,6 +21,8 @@
<convert from="com.ifyouwannabecool" to="com.ifyouwannabecool.client"/>
</package-conversions>
</java-xml-client>
+ <jackson disabled="true"/>
+ <jackson1 disabled="true"/>
@stoicflame
stoicflame / Main.java
Created March 25, 2015 19:22
Using the FamilySearch Client For OAuth 2 Authorization Code Flow
package org.familysearch.api.client;
import org.gedcomx.rs.client.PersonState;
/**
* @author Ryan Heaton
*/
public class Main {
public static void main(String[] args) {
package org.codehaus.enunciate.domain.login;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.StringReader;
/**
* @author Ryan Heaton
*/
@XmlRootElement
@stoicflame
stoicflame / enunciate-common.h
Created July 5, 2013 16:58
This is a sample of [Enunciate](http://enunciate.codehaus.org)-generated Objective-C code. Since I'm not an Objective-C programmer, I'm looking for any feedback on how to make this better. Help me out by forking and/or commenting as needed.
/**
*
*
* Generated by <a href="http://enunciate.codehaus.org">Enunciate</a>.
*/
#import <libxml/xmlwriter.h>
#import <libxml/xmlreader.h>
#import <Foundation/Foundation.h>
#ifndef DEBUG_ENUNCIATE
@stoicflame
stoicflame / ResourceType.java
Created August 14, 2012 16:31
new resource types
/**
* Copyright 2011-2012 Intellectual Reserve, Inc.
*
* Licensed 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
*
* Unless required by applicable law or agreed to in writing, software
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 285.05.09 ([email protected]) Fri Sep 23 17:55:57 PDT 2011
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection
@Path("/path/to/my/changes")
public class ChangeHistoryResource {
public static final String START_DEFAULT = "0";
public static final String COUNT_DEFAULT = "100";
...
public ChangeListOrWhateverItsCalled getChangeList(@QueryParam("start") @DefaultValue(START_DEFAULT) String start,
@QueryParam("count") @DefaultValue(COUNT_DEFAULT) Integer count) {
@stoicflame
stoicflame / SampleOAuth2ClientSecret.java
Created March 15, 2012 17:12
Sample code for signing a client secret for FamilySearch oauth2 confidential client
KeyStore ks = KeyStore.getInstance("JKS");
char[] password = "mypassword".toCharArray();
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("mykeystore.jks");
ks.load(is, password);
is.close();
PrivateKey privateKey = (PrivateKey)ks.getKey("mykey", password);
// Create the secret with the private key
Security.addProvider(new BouncyCastleProvider());
long timestamp = System.currentTimeMillis();
@stoicflame
stoicflame / User.java
Created October 13, 2011 18:49
Custom JSON Jackson Properties
public class User {
private Date dtBirth;
@JsonIgnore
public Date getDtBirth() { return dtBirth; }
@JsonIgnore
public void setDtBirth(Date dtBirth) { this.dtBirth = dtBirth; }
@stoicflame
stoicflame / DataHandlerReader.java
Created September 15, 2011 15:58
implementation of a MessageBodyReader<DataHandler>
import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.ws.rs.Consumes;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyReader;
import javax.ws.rs.ext.Provider;
import java.io.IOException;