Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

{"data":"I am small sized body"}
{"data": "0000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 00000000 0000 0000 0000 0000 0000 0000 0000
@chudilka1
chudilka1 / python_mock_server.py
Last active September 17, 2023 12:58
Python mock server
#!/usr/bin/env python3
"""
Very simple HTTP server in Python
1. Create `mock-server` dir
2. Put this script and .json files (representing responses) into the folder
3. In CLI run: cd ~/mock-server && python3 server.py [<any_available_and_preferrable_port>] - server will be running on localhost (127.0.0.1:<port>)
4. To request resources locally: `localhost:<port>/<name_of_resource>.json`
5. To request resources remotely:
@chudilka1
chudilka1 / functions_request_size_exceeds_2kb.js
Created August 9, 2023 17:46
Functions request with body exceeding 2kb
// No authentication. demonstrate POST with data in body
// docs: https://dummyjson.com/docs
// make HTTP request
const title = args[0]
const url = "https://dummyjson.com/posts/add"
console.log(`Create post`)
console.log(`HTTP POST Request to ${url}`)
const createPostRequest = Functions.makeHttpRequest({
@chudilka1
chudilka1 / AttachmentListener.java
Created March 4, 2020 13:49
AttachmentListener
import java.io.ByteArrayInputStream;
import java.util.Date;
import java.util.UUID;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.logging.LogEntries;
import org.openqa.selenium.logging.LogEntry;
import org.openqa.selenium.logging.LogType;
import org.testng.ITestResult;