Skip to content

Instantly share code, notes, and snippets.

View indyone's full-sized avatar
🍕
Yummie code!

Ioannis Stavrinos indyone

🍕
Yummie code!
  • @StoiximanServices
  • Athinai, Greece
View GitHub Profile
@indyone
indyone / MockHttpServer.cs
Last active February 28, 2022 11:41
HTTP server for mocking responses on unit tests
using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace UnitTest.Utilities;
public class MockHttpServer : IDisposable
{
@indyone
indyone / Program.cs
Last active January 23, 2022 17:29
Wordle Solver
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.Playwright;
public class Program
{
@indyone
indyone / EduPass.csproj
Last active February 4, 2022 07:47
EduPass Generator for Lame Fathers (and Mothers)
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>10</LangVersion>
</PropertyGroup>
@indyone
indyone / Program.cs
Last active November 22, 2021 10:24
SprinklesEverywhere
using CsvHelper;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Mail;
namespace SprinklesEverywhere
@indyone
indyone / README.md
Last active September 30, 2020 07:54
Log full request including the all headers & body with Nginx/OpenResty

Usage

  1. Ensure that you have a working Docker installation
  2. Create the folder conf.d on your working path
  3. Download and copy the default.conf from this gist into the conf.d folder
  4. Run the docker command
docker run -p 80:80 -v <working-path>/conf.d:/etc/nginx/conf.d --name nginx-logging openresty/openresty:alpine

Make sure you replace the <working-path> with the full path of the directory that contains the conf.d folder.

@indyone
indyone / RabbitMQChatClient.md
Created December 4, 2019 13:36
Implementation specs for a chat client over RabbitMQ

Chat Client over RabbitMQ

The concept for this exercise is to create a de-centralized chat service (meaning without a chat server to coordinate and manage the users or messages). We will use the RabbitMQ message broker to publish and receive the messages that will follow a specific API. Then we will implement a client that will use this API and provide the user interface for chatting with other users.

The Chat Client Application

The chat client should have te following specifications:

ASP.NET MVC Exercise

With this exercise you will learn how to setup an ASP.NET MVC project on Visual Studio and build a fully-functional but simple web application.

Prerequisites

To develop this web application on your PC, you will need the following to be installed and configured:

@indyone
indyone / Students.linq
Created November 18, 2019 12:55
Sample LINQPad file for playing with the LINQ to Objects
public class Student
{
public string Name;
public string Teacher;
public double Grade;
}
void Main()
{
var a = new Student { Name = "Ioannis", Teacher = "Nikos", Grade = 3.0 };
@indyone
indyone / RecipeApp.cs
Last active November 11, 2019 14:44
Sample Recipe Application
This sample application is to quickly get started for the .NET training.
Using this code you can demostrate the:
- Creating a Project
- Basic Debugging
- Adding a Class Library (Move the `Recipe` class on its own project)
- Using a Nuget Package (eg. Humanizer)
@indyone
indyone / Coding School - Todo API.md
Last active October 13, 2017 18:32
Coding School - Todo API

Coding School - Todo API

Quickstart guide

  1. Create a new Web API Project
  2. Add a new model file in the path Models\Todo.cs and copy & paste the content from the Models\Todo.cs gist file
  3. Add a new controller file in the path Controllers\TodoController.cs and copy & paste the content from the Controllers\TodoController.cs gist file
  4. Hit Ctrl+F5 to start app without debugging
  5. Navigate your web browser to http://localhost:52548/api/todo - Note: You may need to change the port

For more experience