Skip to content

Instantly share code, notes, and snippets.

View nakov's full-sized 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 / FormBulbController.cs
Last active January 19, 2020 16:13
ESP8266 with Thinger.io for Bulb control
using System;
using System.Net.Http;
using System.Windows.Forms;
namespace ESP8266BulbControl
{
public partial class FormBulbController : Form
{
HttpClient http = new HttpClient();
@nakov
nakov / ListExamples.cs
Last active April 21, 2020 11:57
Arrays and Lists in C#, Java, Python and JavaScript
// List examples in C#
using System;
using System.Collections.Generic;
using System.Linq;
class ListExamples
{
static void Main()
{
@nakov
nakov / README.md
Last active May 6, 2020 07:53
WordPress + MySQL on Docker Compose

Install Docker / or use Play with Docker (https://labs.play-with-docker.com) with Docker Hub free registration.

Create the docker-compose.yml file, e.g. using cat > docker-compose.yml

Run the containers (WordPress and MySQL):

docker-compose up -d

Check the containers state:

using System;
class Program
{
static void Main()
{
long num = 2882400063;
string result = "";
while (num > 0)
{
@nakov
nakov / ffmpeg -h decoder=h264_cuvid
Created November 29, 2020 16:09
ffmpeg: NVidia hardware encoder `h264_nvenc` and hardware decoder `h264_cuvid` - Documentation (Nov 2020)
ffmpeg version 2020-11-29-git-f194cedfe6-full_build-www.gyan.dev Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.2.0 (Rev5, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable
@nakov
nakov / PowerPoint-Line-Breaks-Word-Wrap-latinLnBrk.txt
Created December 10, 2020 14:10
PowerPoint: fix incorrect line breaking in the middle of the words
latinLnBrk - specifies whether lines breaks could split a latin word
Should be: latinLnBrk="0"
Broken line breaks:
<a:lvl1pPr marL="0" indent="0" algn="l" defTabSz="1218438" rtl="0" eaLnBrk="1" latinLnBrk="1" hangingPunct="1">
За съжаление няма лесен начин за оправяне. Аз лично правя следното:
1) unzip на PPTX файла -> файлът става на папка с насипни файлове (XML + картинки)
@nakov
nakov / ffmpeg-multi-output.txt
Created December 17, 2020 16:07
ffmpeg --> multiple output transcoding with a single command and hardware accelaration
ffmpeg.exe -hwaccel cuvid -hwaccel_output_format cuda -c:v h264_cuvid -i input.mp4 -c:v h264_nvenc -vf scale_cuda=w=-1:h=1080:interp_algo=bilinear -r 30 -g 60 -rc vbr -cq 34 -c:a aac -b:a 192k -y sample-1080p.mp4 -c:v h264_nvenc -vf scale_cuda=w=-1:h=720:interp_algo=bilinear -r 30 -g 60 -rc vbr -multipass fullres -cq 34 -c:a aac -b:a 128k -y sample-720p.mp4 -c:v h264_nvenc -vf scale_cuda=w=-1:h=480:interp_algo=bilinear -r 25 -g 50 -rc vbr -multipass fullres -cq 32 -c:a aac -b:a 96k -y sample-480p.mp4 -c:v h264_nvenc -vf scale_cuda=w=-1:h=360:interp_algo=bilinear -r 24 -g 48 -rc vbr -multipass fullres -cq 37 -c:a aac -b:a 64k -y sample-360p.mp4 -c:v h264_nvenc -vf scale_cuda=w=-1:h=240:interp_algo=bilinear -r 15 -g 30 -rc vbr -multipass fullres -cq 32 -c:a aac -b:a 48k -y sample-240p.mp4
The above command transcodes mkv input video from 1080p to mp4 streamable video 1080p, 720p, 480p, 360p and 240p (5 output bitrates)
@nakov
nakov / AttachToExternalProcessConsole.cs
Created December 19, 2020 02:02
Example of how to attach to an external process's console in Windows
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@nakov
nakov / example.js
Created January 19, 2021 19:21
Postman API Test - example
pm.test("Status code 200 OK", function() {
pm.response.to.have.status(200);
});
pm.test("Response is arrays of issues", function() {
pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json; charset=utf-8');
const json = pm.response.json();
pm.expect(Array.isArray(json)).equals(true);
for (let item of json) {
pm.expect(typeof(item)).equals("object");
@nakov
nakov / GitHubIssuesTests.cs
Created January 19, 2021 20:25
API Testing with C# (NUnit + RestSharp)
using NUnit.Framework;
using RestSharp;
using RestSharp.Authenticators;
using RestSharp.Serialization.Json;
using System;
using System.Collections.Generic;
using System.Net;
namespace API_Tests_GitHub
{