Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focused on the global SoftUni expansion: https://softuni.org

Svetlin Nakov nakov

🎯
Focused on the global SoftUni expansion: https://softuni.org
View GitHub Profile
@nakov
nakov / TestsContactBookAndroidApp.cs
Created Mar 26, 2021
Appium Test for the ContactBook app
View TestsContactBookAndroidApp.cs
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Android;
using OpenQA.Selenium.Remote;
using System;
namespace AppiumTests_ContactBook
{
public class TestsContactBookAndroidApp
@nakov
nakov / APITestsContactBook.cs
Created Mar 12, 2021
ContactBook API Tests
View APITestsContactBook.cs
using NUnit.Framework;
using RestSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text.Json;
public class APITestsContactBook
{
@nakov
nakov / ffmpeg-avi-to-gif.cmd
Last active Apr 8, 2021
Create highly-optimized GIF from screencast video (MP4)
View ffmpeg-avi-to-gif.cmd
ffmpeg -i .\input.avi -vf scale=1280x720 -crf 0 -r 4 -an -y out.mp4
ffmpeg -i .\out.mp4 -vf palettegen=256 -y palette.png
ffmpeg -y -i .\out.mp4 -i palette.png -filter_complex paletteuse -y animation.gif
del out.mp4
del palette.png
@nakov
nakov / FileXor.cs
Created Mar 10, 2021
C# Encrypt / Decrypt File with XOR
View FileXor.cs
using System.IO;
void EncryptFile(string inputFile, string outputFile)
{
using (var fin = new FileStream(inputFile, FileMode.Open))
using (var fout = new FileStream(outputFile, FileMode.Create))
{
byte[] buffer = new byte[4096];
while (true)
{
@nakov
nakov / (1) script.js
Last active Feb 25, 2021
k6 Performance Test Script - Example
View (1) script.js
import { sleep, group, check } from "k6";
import http from "k6/http";
export let options = {
thresholds: {
// 95% of requests must finish within 500 ms & 99% within 1500 ms
http_req_duration: ['p(95) < 500', 'p(99) < 1500'],
},
};
@nakov
nakov / FormUrlEncodedContent.cs
Created Feb 18, 2021
Generate `x-www-form-urlencoded` content in C#
View FormUrlEncodedContent.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
using System.Text;
namespace FormUrlEncodedContentExample
{
class Program
{
@nakov
nakov / MultiBrowserSeleniumTest.cs
Last active Feb 8, 2021
Run Selenium tests in two Web browsers in parallel with NUnit
View MultiBrowserSeleniumTest.cs
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Remote;
using System;
namespace Selenium_Examples
{
[TestFixture(typeof(FirefoxOptions))]
@nakov
nakov / MultiSeleniumTest.cs
Last active Feb 8, 2021
Run Selenium tests in parallel with NUnit
View MultiSeleniumTest.cs
[TestFixture(typeof(FirefoxOptions))]
[TestFixture(typeof(ChromeOptions))]
[Parallelizable(ParallelScope.All)]
public class MultiSeleniumTest<TOptions> where TOptions : DriverOptions, new()
{
[ThreadStatic]
private static IWebDriver driver;
[SetUp]
public void Setup()
@nakov
nakov / SeleniumTestsChrome.cs
Created Jan 26, 2021
XE.com Selenium automated test
View SeleniumTestsChrome.cs
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Support.UI;
using System;
public class SeleniumTestsChrome
{
private IWebDriver driver;
@nakov
nakov / SeleniumTests.cs
Created Jan 26, 2021
Selenium Basics course @ SoftUni - first homework
View SeleniumTests.cs
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using System;
public class SeleniumTests
{
IWebDriver driver;
[SetUp]