Skip to content

Instantly share code, notes, and snippets.

View avendasora's full-sized avatar

David Avendasora avendasora

  • Nekesto, Inc.
  • Falls Church, Virginia
View GitHub Profile
@avendasora
avendasora / json-to-dynamodb-json.template
Created April 18, 2017 17:27
AWS API Gateway body mapping template to convert simple JSON into DynamoDB JSON
#set($tableName = $input.params("tableName"))
#set($inputRoot = $input.path('$'))
{
"TableName": "$tableName",
"Item": {
"request_id": {
"S": "$context.requestId"
},
#foreach($key in $inputRoot.keySet())
#set($value = $inputRoot.get($key))
@avendasora
avendasora / form-to-dynamodb-json.template
Last active September 20, 2022 05:00
AWS API Gateway body mapping template to convert "application/x-www-form-urlencoded" into "application/json" for DynamoDB
#set ($keyValues = {})
#set($prarametersString = $input.body)
#set($parameters = $prarametersString.split("&"))
#foreach($parameter in $parameters)
#set($keyValue = $parameter.split("="))
$keyValues.put($util.urlDecode($keyValue[0]),$util.urlDecode($keyValue[1]))
#end
{
"TableName": "table_name",
"Item": {
@avendasora
avendasora / Status.java
Last active November 5, 2015 16:28
Basic implementation of javax.ws.rs.core.Response.StatusType with additional HTTP Status codes. You should be able to use any of the constants defined in this enum just like you would use the constants (OK, CREATED, DELETED, etc.) defined in javax.ws.rs.core.Response.Status
package avendasora.http;
import javax.ws.rs.core.Response.StatusType;
import javax.ws.rs.core.Response.Status.Family;
public enum Status implements StatusType {
/**
* 100 Continue, see
* {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.1.1">HTTP/1.1 documentation</a>}
* .
@avendasora
avendasora / WebObjectsLocalAppDeployerScript.sh
Created May 22, 2011 15:18
Scripts to run as part of a Hudson job to Deploy applications built by a Hudson job to a specified WebObjects server running Project WOnder's wotaskd. These scripts should be saved in a subdirectory of the Hudson job's workspace directory.
#!/bin/bash
PROJECT=$1
BUILD_NUMBER=$2
BUILD_ID=$3
MONITOR_HOST=$4
MONITOR_PORT=$5
APP_ROOT=$6
WEB_ROOT=$7
@avendasora
avendasora / WebObjectsAppDeployerScript.sh
Created May 22, 2011 15:11
Script that will install a WebObjects app on a WebObjects server running Project WOnder's wotaskd.
#!/bin/bash
PROJECT=$1
BUILD_NUMBER=$2
BUILD_ID=$3
MONITOR_HOST=$4
MONITOR_PORT=$5
APP_ROOT=$6
WEB_ROOT=$7
@avendasora
avendasora / InstallWebObjects
Created May 22, 2011 12:03
Script to run as part of a Hudson job to Install WebObjects in a Frameworks Repository for use by the job.
#!/bin/bash
FRAMEWORKS_REPOSITORY=${HUDSON_HOME}/WOFrameworksRepository
echo "Repository: ${FRAMEWORKS_REPOSITORY}"
echo "WO Version: ${WO_VERSION}"
if [ "${FRAMEWORKS_REPOSITORY}" == "" ]; then
echo "You must provide a FRAMEWORK_REPOSITORY setting."
exit 1
fi
@avendasora
avendasora / go_wolips
Created May 22, 2011 11:41
script to install and setup wolips
#!/bin/bash
ECLIPSE_URL=http://mirror.cc.vt.edu/pub/eclipse/eclipse/downloads/drops/R-3.6.1-201009090800/eclipse-SDK-3.6.1-macosx-cocoa-x86_64.tar.gz
P2_URL=http://gist.github.com/raw/609891/p2
WORKSPACE_MECHANIC_URL=http://wiki.objectstyle.org/confluence/download/attachments/8225785/WorkspaceMechanicExamples.zip
WORKSPACE_MECHANIC_FOLDER=~/.eclipse/mechanic
VERSION=`date +%s`
if [ "$#" != "1" ]; then
echo "usage: $0 [install folder]"
exit