Skip to content

Instantly share code, notes, and snippets.

View azagniotov's full-sized avatar
🎯
Ranking ..

Alexander Zagniotov azagniotov

🎯
Ranking ..
View GitHub Profile
/*
alexPrintPrep($("textarea#phrase").val(), null, 210);
alexPrintPrep(address, privkey, 100);
<div id="printable-view-for-alex" class="alex-qr-container"></div>
@media print
{
{
"reservation" : "p5e20A9hSi2IsV0soVpafQ==",
"name" : "Leanne Graham",
"phone" : "1-770-736-8031 x56442",
"basePrice" : "USD10.00",
"taxes" : "EUR19.62"
}
@azagniotov
azagniotov / include-reservation-service-stubs.yaml
Created May 2, 2021 23:51
include-reservation-service-stubs.yaml
- request:
method: GET
url: /api/v1/reservations/1
# When sequenced responses is configured, on each incoming request to the same URI,
# a subsequent response in the list will be sent to the client. The sequenced
# responses play in a cycle (loop). In other words: after the response sequence plays
# through, the cycle restarts on the next incoming request
#
# https://github.com/azagniotov/stubby4j#response-object-properties
@azagniotov
azagniotov / include-account-service-stubs.yaml
Created May 2, 2021 23:48
include-account-service-stubs.yaml
- request:
method: GET
url: /api/v1/accounts/1
response:
status: 200
headers:
content-type: application/json
file: json/account.service.expected.success.response.json
@azagniotov
azagniotov / stubs.yaml
Created May 2, 2021 23:38
stubby4j config
includes:
- include-account-service-stubs.yaml
- include-reservation-service-stubs.yaml
@azagniotov
azagniotov / docker-compose.yaml
Created May 2, 2021 23:32
Using stubby4j in docker-compose.yaml
# This section builds flight-booking application image to the stack
version: '3.8'
services:
flight-booking-service:
build: .
container_name: flight-booking-service
ports:
- 8080:8080
environment:
Use-case # Account service Reservation service
1 200 OK 200 OK
2 200 OK 400 Bad Request
3 200 OK 403 Forbidden
4 200 OK 500 Internal Server Error
5 200 OK 200 OK (after 1500 millis to cause a read timeout) *
@azagniotov
azagniotov / beautiful.rest.api.docs.in.markdown.md
Last active November 13, 2024 13:40
Example to create beautiful REST API docs in Markdown, inspired by Swagger API docs.
@azagniotov
azagniotov / download.all.adp.paystubs.js
Last active September 7, 2024 18:24
Downloads all pay-slips from ADP website
/*
This has been tested in Chrome v55.0.2883.95 (64-bit)
1. Log into ADP website using the URL: https://my.adp.com/static/redbox/login.html (Make sure you are NOT in Incognito mode)
2. Open Developer Tools console
3. Run the following code in the console:
*/
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://my.adp.com/v1_0/O/A/payStatements?adjustments=yes&numberoflastpaydates=300');
import org.junit.Test;
import java.util.regex.Pattern;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class NegativeRegexTest {