What do you want to save?
Add Code snippet
New code examples
-
Other 2021-10-25 23:22:04
adding queryparams resttemplate
String url = "http://test.com/solarSystem/planets/{planet}/moons/{moon}"; // URI (URL) parameters Map<String, String> urlParams = new HashMap<>(); urlParams.put("planets", "Mars"); urlParams.put("moons"... Add solution -
Python 2021-10-20 12:24:09
alpaca examples
import alpaca_trade_api as tradeapi # authentication and connection details api_key = 'Insert_your_api_key_here' api_secret = 'Insert_your_api_secret_here' base_url = 'https://paper-api.alpaca.markets' # instantiate REST API api = tradeapi.REST(api_key,... Add solution -
Javascript 2021-10-17 15:20:09
canvas rounded corners on image
ctx.save(); ctx.beginPath(); // use lineTo and BezierTo here to make the path you want, which is a rectangle the size of the image with two rounded corners. ctx.closePath(); ctx.clip(); // draw the image using ctx.drawImage(.. ctx.restore(); // so clipp... Add solution -
Javascript 2021-10-16 19:21:05
js request validator
// ...rest of the initial code omitted for simplicity.const { body, validationResult } = require('express-validator'); app.post( '/user', // username must be an email body('username').isEmail(), // password must be at least 5 chars lo... Add solution -
Go 2021-10-16 14:18:07
mongo db returning null in array of string graphql
// Using the same query as aboveconst result = await client.query({ query: query });if (result.data.restaurants) { result.data.restaurants.forEach(restaurant => { if (restaurant) { console.log(restaurant.name); console.log(restaurant.loca... Add solution -
Javascript 2021-10-15 02:43:08
js spread parameters
// spread operators can be used for arrays or objects // cloning to prevent mutation. let numList = [1,2,3]; let numListClone = [...numList]; // [1, 2, 3] // spread operator for destructuring. let animal = { name: 'dog', color: 'brown', age: 7 }; ... Add solution -
Other 2021-10-14 19:02:11
rest assured time response
import org.testng.annotations.Test; import io.restassured.builder.RequestSpecBuilder; import io.restassured.response.Response; import io.restassured.specification.RequestSpecification; import static io.restassured.RestAssured.given; public class Exampl... Add solution