Skip to content

Instantly share code, notes, and snippets.

View NikolayIT's full-sized avatar

Nikolay Kostov NikolayIT

View GitHub Profile
using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.Razor;
using Microsoft.AspNetCore.Mvc.Rendering;
"use strict";
var page = require('webpage').create(),
system = require('system'),
address,
output;
console.log('Usage: rasterize.js [URL] [filename] [paperformat] [orientation]');
address = system.args[1];
output = system.args[2];
using System;
using System.Diagnostics;
using System.IO;
public interface IHtmlToPdfConverter
{
byte[] Convert(string basePath, string htmlCode, FormatType formatType, OrientationType orientationType);
}
public class HtmlToPdfConverter : IHtmlToPdfConverter
private readonly IViewRenderService viewRenderService;
private readonly IHtmlToPdfConverter htmlToPdfConverter;
private readonly IHostingEnvironment environment;
public DashboardController(
IViewRenderService viewRenderService,
IHtmlToPdfConverter htmlToPdfConverter,
IHostingEnvironment environment)
{
this.viewRenderService = viewRenderService;
@NikolayIT
NikolayIT / Dota2LeaderboardTracker.cs
Last active July 1, 2018 14:51
Tracking changes in Dota 2 leaderboard pages
namespace DotaLeaderboardsUpdates
{
using System;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading;
using Newtonsoft.Json;
@NikolayIT
NikolayIT / SimpleHttpServerWithTcpListener.cs
Created September 16, 2018 12:26
Simple HTTP server in .NET Core using TcpListener
namespace SimpleHttpServer
{
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
public static class Program
{
public static void Main(string[] args)
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
namespace ExpressionEvaluator
{
class Program
{
static void Main(string[] args)
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Net;
using System.Net.Http;
using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.Extensions.Configuration;