Skip to content

Instantly share code, notes, and snippets.

View ginomessmer's full-sized avatar

Gino Messmer ginomessmer

View GitHub Profile
@ginomessmer
ginomessmer / GetUserRequest.cs
Created May 25, 2020 09:07
Unidash MediatR
namespace Unidash.Auth.Users.Requests
{
public class GetUserRequest : IRequest<IActionResult>
{
public string Id { get; set; }
public GetUserRequest(string id)
{
Id = id;
}
config:
target: 'https://example.com'
phases:
- name: 'Warm up'
duration: 60
arrivalRate: 10 # 10 new users per second
rampTo: 40
- name: 'Max load'
duration: 240
arrivalCount: 200 # Have 200 users at the end of the duration
public static IEnumerable<IEnumerable<T>> Chunk<T>(this IEnumerable<T> list, int chunkSize)
{
if (chunkSize <= 0)
{
throw new ArgumentException("chunkSize must be greater than 0.");
}
while (list.Any())
{
yield return list.Take(chunkSize);
@ginomessmer
ginomessmer / 404.html
Created March 1, 2019 19:54
Plain simple 404 page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>404, that's an error</title>
</head>
<style>
server {
listen 80;
listen [::]:80;
server_name example.com www.example.com;
location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
// ==UserScript==
// @name Copy Azure DevOps ticket to mite scheme
// @namespace https://github.com/ginomessmer/
// @version 0.1
// @description See title
// @author Gino Messmer
// @include https://*.visualstudio.com/*
// @grant none
// ==/UserScript==
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
// Taken from https://raw.githubusercontent.com/devbridge/AzurePowerTools/
@ginomessmer
ginomessmer / redirect-https.web.config
Created December 5, 2017 19:58
Redirect HTTP to HTTPS on IIS
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP/S to HTTPS Redirect" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{SERVER_PORT_SECURE}" pattern="^0$" />
</conditions>
@ginomessmer
ginomessmer / HttpAlive.cs
Last active June 27, 2017 09:17
HTTP Alive - Checks whether a website is up and running or nuked
using System;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using static System.Console;
namespace HttpAlive
{
class Program
{
@ginomessmer
ginomessmer / official_rsg_crews.json
Last active February 22, 2017 20:05
Official three tags Rockstar Games SC crews
{
"crews": [
"IGN",
"MP3",
"LSB",
"ZBC",
"RDR",
"TMC",
"MHE",
"LAN",