Skip to content

Instantly share code, notes, and snippets.

View vdespa's full-sized avatar

Valentin Despa vdespa

View GitHub Profile
@vdespa
vdespa / collection.json
Created January 15, 2024 19:30
Mistral AI API Postman collection
{
"info": {
"_postman_id": "f2f80199-0b76-4e18-85de-680172cd17d6",
"name": "Mistral AI API",
"description": "To get started, you need to set the Postman collection variable `mistralAPIKey` with a valid Mistral AI API key.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "20537536"
},
"item": [
{
@vdespa
vdespa / collection.json
Created September 26, 2019 18:31
Postman collection with variable for the file name
{
"info": {
"_postman_id": "d7e89525-371a-4d96-8683-ea3d9a40c0ca",
"name": "Upload",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "https://hookb.in/OeZner0EOYTyVylW6bWj",
"event": [
while true; do for f in *.svg; do echo "Processing $f file.."; rsvg-convert -h 1080 $f > $f.png; rm $f; done; sleep 5; done
@vdespa
vdespa / script.sh
Created May 9, 2019 06:36
Convert svg to png
for f in *.svg; \
do echo "Processing $f file.."; \
rsvg-convert -h 1080 $f > $f.png; \
rm $f; \
done
@vdespa
vdespa / script.js
Created April 2, 2019 10:58
Simple example for reusing Postman scripts
const commonTests = () => {
pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});
}
pm.globals.set('commonTests', commonTests.toString());
eval(pm.globals.get('commonTests'))();
newman run "https://www.getpostman.com/collections/f36406f34fcc7d4e0502" --suppress-exit-code --reporters teamcity,cli,html --reporter-html-export newman/report.html
newman run "https://www.getpostman.com/collections/f36406f34fcc7d4e0502" --reporters teamcity,cli
newman run "https://www.getpostman.com/collections/f36406f34fcc7d4e0502"
@vdespa
vdespa / script.js
Created April 11, 2018 11:29
Running newman as a Node.js module
const newman = require('newman');
newman.run({
collection: require(‘./postman_collection.json’),
reporters: 'cli'
}, function (err) {
if (err) { throw err; }
console.log('Collection run complete!');
});
@vdespa
vdespa / script.js
Created April 11, 2018 11:26
Write file to disk
const fs = require('fs');
fs.writeFile(`foo.txt`, 'bar', function (error) {
if (error) { 
console.error(error); 
}
});