18 February 2021

Apócope

En gramática, una apócope (del griego apokopé < apokopto, "cortar") es un metaplasmo donde se produce la pérdida o desaparición de uno o varios fonemas o sílabas al final de algunas palabras. Cuando la pérdida se produce al principio de la palabra se denomina aféresis, y si la pérdida tiene lugar en medio de la palabra se llama síncopa. Es una figura de dicción según la preceptiva tradicional. 

 

https://es.wikipedia.org/wiki/Ap%C3%B3cope

09 February 2021

Swagger to PDF/HTML5

     Pasos swagger:


    We need to have installed the following tools: swagger2markup and asciidoctor

  • brew install asciidoctor
  • brew install swagger2markup-cli    
  1.     get swagger.json with springboot up&running:
        http://127.0.0.1:8080/v2/api-docs
  2.     copy swagger.json
  3.     mkdir adocs
  4.     swagger2markup convert -i swagger.json -d adocs
  5.     modify overview.adoc (title =)
  6.     asciidoctor index.adoc
  7.     asciidoctor-pdf index.adoc



    $  cat index.adoc
    :doctype: book
    :toc: left
    :toclevels: 3
    :numbered:
    :hardbreaks:
    :sectlinks:
    :sectanchors:

    include::./overview.adoc[]
    include::./paths.adoc[]
    include::./security.adoc[]
    include::./definitions.adoc[]


14 January 2021

Java Copy Constructor

Sometimes we need to clone an object in Java, but not a reference (a junior developer may use). There are several ways to achieve this task; however, I recommend to use a copy-constructor (that comes from C++) and, in particular, using @Builder from Lombok (to avoid boilerplate code))

 



24 December 2020

curl cheat sheet

 Curl, the wget with steroids. https://curl.se/

1. response headers

curl -I http://localhost:8081/customers

HTTP/1.1 302
Set-Cookie: KC_REDIRECT=/customers; Path=/; HttpOnly
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Location: http://localhost:8081/sso/login
Transfer-Encoding: chunked
Date: Sun, 27 Dec 2020 15:38:57 GMT

2.  gzip call

curl -v -H "Content-Type: application/json" -H "Accept-Encoding: gzip" -I http://127.0.0.1:8080/example/fourkb 

Content-Encoding: gzip
Content-Type: application/json


curl -v -H "Content-Type: application/json" -H "Accept-Encoding: gzip" http://127.0.0.1:8080/fourkb -o four.json.gz

curl -v --compressed
-verbose

3.  curl post

curl -k --max-time 30 -X GET 'https://10.10.10.31:8080/rest/accounts?user=test&password=test&channel=1&client-ID=1020'
 --request GET

 
 
4. body:

curl -k --request POST 'https://10.10.10.31:8080/rest/num-accounts' --header 'Content-Type: application/json' --data-raw '{"user":{"user":"testuser","password":"welcome1","request-channel":1},"client-ID":"12345"}'

-d '{"query":{"match_all":{}}}'
-d, --data <data>



5. ssl

-k

curl --cacert cacert.pem https://self-signed.badssl.com


6. cookie

--cookie "jsessionid=123"


7. timeout

--max-time 30


8. header

curl -H "Authorization: Basic YXBpdXNlcjphcGlwd2Q=" http://devweb.cl/status


9.  basic user?

--basic --user "redemption-br:GUkboMIZ"


07 December 2020

API Integrations Summary

The concept of API integrations is broad. This must consider a function and non-functional requirements (today called quality attributes).

There several ways to integrate to an API


One way that integrating with third-party, or partner, APIs can be easier is by using a client or SDK. API clients handle much of the overhead when interacting with an API. They can handle common tasks like:

  • Authentication
  • Error handling
  • Encoding requests and parsing responses
  • Simplifying requests
  • Offering a better user experience than direct usage
  1. API integration of workflow !
  2. different user story --> workflows !


Track performance

The work isn’t over once you set up your API integrations. While we all would like to “set and forget” an integration, the truth is that any dependency is also a liability. You can start by monitoring your API usage. Specifically, here are the metrics we think are the most important:

  •     Latency
  •     Response Time
  •     Availability
  •     Consumption
  •     Failure Rate
  •     Status Codes

 

  1. https://blog.cloud-elements.com/10-step-guide-designing-api-integration
  2. https://www.infoq.com/articles/api-first-integration/
  3. https://blog.bearer.sh/api-integration-best-practices/




Modern C for Absolute Beginners

Modern C for Absolute Beginners
A Friendly Introduction to the C Programming Language

https://www.apress.com/gp/book/9781484266427


Authors: Dmitrovic, Slobodan



My Blog List

Blog Archive

Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.