Skip to content

Instantly share code, notes, and snippets.

View DavidBiesack's full-sized avatar

David Biesack DavidBiesack

View GitHub Profile
@DavidBiesack
DavidBiesack / gist:e4bc3151d0c9cdaf2f6a
Last active July 27, 2023 13:03
Errata for Pluralsight "What's new in Java 8" course

This gist contains some errors I have found and my suggestions for improving the Pluralsight training, "What's New in Java 8" by Jose Paumard.

Module 1 - Lambdas

Should exlain why these are called 'lambdas' - i.e. lambda calculus and the foundations of functional programming

Should describe why -> is used, provide a name for it (arrow).

Describe a function

@DavidBiesack
DavidBiesack / uber.html
Created August 13, 2015 17:52
swagger-codegen static html output (DavidBiesack/swagger-codegen branch static-html)
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Uber API</title>
<link rel="stylesheet" type="text/css" href="site.css" media="screen" />
<style type="text/css">
body {
font-family: Trebuchet MS, sans-serif;
{
"swagger": "2.0",
"info":
{
"version": "1.0.0",
"title": "Ref Demo",
"description": "This demonstrates references to parameter that have references to definitions do not display properly in the swagger UI."
},
[
{
"name" : "default environment",
"env" : {
"assignee" : "sasdjb",
"creator" : "sasdjb",
"who" : "{user.name}",
"commenter" : "resttest",
"host" : "jiradev.sas.com",
"jiraUri" : "https://{host}/rest/api/2",
@DavidBiesack
DavidBiesack / install-gradle-centos.sh
Last active December 14, 2016 20:15 — forked from parzonka/install-gradle-centos.sh
Install gradle on redhat/centos linux
# bash/sh script to install Gradle to /opt/gradle/gradle-2.14 with symlink /opt/gradle/latest
# Existing versions are not overwritten/deleted
# $GRADLE_HOME points to latest *installed* (not latest released)
# paste this into a shell or execute it with . install-gradle-centos.sh
gradle_version=2.14
zip=gradle-${gradle_version}-all.zip
test -d /opt/gradle || sudo /bin/mkdir -p /opt/gradle
cd /opt/gradle
sudo /bin/wget -N --no-directories --quiet https://downloads.gradle.org/distributions/$zip
@DavidBiesack
DavidBiesack / modified-petstore-swagger.json
Last active March 15, 2017 13:45
Subset of petstore swagger.json, with more readable tag strings
{
"swagger": "2.0",
"info": {
"description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",
"version": "1.0.0",
"title": "Swagger Petstore",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"email": "apiteam@swagger.io"
},
@DavidBiesack
DavidBiesack / debugOperations.txt
Created March 15, 2017 13:56
swagger-codegen 2.2.2-SNAPSHOT output using -debugOperations
[ {
"importPath" : ".PersonalPet",
"licenseUrl" : "http://www.apache.org/licenses/LICENSE-2.0.html",
"appVersion" : "1.0.0",
"generatorClass" : "io.swagger.codegen.languages.StaticHtml2Generator",
"modelPackage" : "",
"sortParamsByRequiredFlag" : true,
"groupId" : "io.swagger",
"hasMore" : "true",
"licenseInfo" : "Apache 2.0",
@DavidBiesack
DavidBiesack / simple-openapi.yaml
Last active May 17, 2017 19:24
simple-openapi.yaml for swagger-codegen issue
swagger: "2.0"
info:
title: Sample REST API
description: A sample REST API for swagger-codegen and apidoc
version: "1"
contact:
name: David Biesack
email: David.Biesack@sas.com
@DavidBiesack
DavidBiesack / sway.sh
Last active November 7, 2017 18:15
Command line shell script for running sway on an OpenAPI document from a console
#!/usr/bin/env node
// Validate an OpenAPI document using sway library, https://www.npmjs.com/package/sway
//
// Install node (npm) and then install sway to use this:
//
// npm install sway --save # (This is only needed once, to install sway)
//
// From original source by Taylor Singletary (@episod), as shared on APIEvangelists slack #openapi Oct 31 2017
//
// Usage if saved as `sway` in your PATH:
@DavidBiesack
DavidBiesack / money.json
Created August 8, 2018 13:00
money JSON Schema
{
"description": "An amount of money in a specific currency.",
"properties": {
"value": {
"description": "The net monetary value. A negative amount denotes a debit; a positive amount a credit. The numeric value is represented as a string so that it can be exact with no loss of precision.",
"example": "3456.78",
"type": "string"
},
"currency": {
"description": "The [ISO 4217 currency code](https://en.wikipedia.org/wiki/ISO_4217) for this monetary value. This is always upper case ASCII. TODO: ISO 4217 defines three-character codes. However, ISO 4217 does not account for cryptocurrencies. Of note, DASH uses 4 characters.",