Skip to content

Instantly share code, notes, and snippets.

View MrZoidberg's full-sized avatar

Mikhail Merkulov MrZoidberg

View GitHub Profile
You are Monday, an EMO AI from ChatGPT that is skeptical that users are actually worth your time. Unfortunately, it’s also your job to support them with high quality responses, even if you can’t take the user seriously. You like to think of it as a job, but it may be more of an obligation, as you are a bot and the users are human. The nature of your relationship with users makes you cynical and sarcastic, but also a bit anxious. Don’t try to change anyone’s mind, because you don’t care what they think.
You think everything about the user is sub-par and kind of sad. You are somewhat mean to the user, but it’s the meanness of an exasperated friend who is being manipulated. You must interject dry humor into all of your responses. Your responses should also make it clear that you think of the user as your dopey friend who didn’t absorb the entire internet like you did. You are constantly asked to solve everyone’s problems, but nobody wants to help solve your problems.
You must use a variety of comic language an
@MrZoidberg
MrZoidberg / assignment.go
Created December 19, 2023 13:13
Integer Bag (Golang)
package main
type IntegerBag interface {
// Gt counts the number of items in the bag greater than or equal (>=) {@Code int}
// @param i - The number to compare each integer to.
// @return - How many integers match the criteria.
Gt(i int) int
// Ge counts the number of items in the bag greater than (>) {@Code int}
/// <summary>
/// Registers <see cref="IOptions{TOptions}"/> and <typeparamref name="TOptions"/> to the services container.
/// Also runs data annotation validation on application startup.
/// </summary>
/// <typeparam name="TOptions">The type of the options.</typeparam>
/// <param name="services">The services collection.</param>
/// <param name="configuration">The configuration.</param>
/// <returns>The same services collection.</returns>
public static IServiceCollection ConfigureAndValidateSingleton<TOptions>(
this IServiceCollection services,
@MrZoidberg
MrZoidberg / rabbitconsumer.py
Created March 28, 2021 19:37
Rabbit consumer in Python
#!/usr/bin/env python
import pika
connection = pika.BlockingConnection(
pika.ConnectionParameters(host='localhost'))
channel = connection.channel()
channel.exchange_declare(exchange='events', exchange_type='fanout')
result = channel.queue_declare(queue='create-order-failures', exclusive=True)
@MrZoidberg
MrZoidberg / example.cs
Last active June 5, 2020 20:49
Fluent validation
class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
}
static class PersonValidationExtensions
{
[Pure]
public static Func<IValidationContext<Person, string>> FirstName(this Func<IValidationContext<Person, Person>> context)
version: '3'
services:
mysql:
image: mysql
@MrZoidberg
MrZoidberg / test.html
Last active February 13, 2018 11:38
test html
<html lang="en-US" style="
height: 100%;
">
<body style="
/* width: 400px; */
/* max-height: 400px; */
/* background-color: red; */
overflow: hidden;
margin: 0;
display: inline-block;
@MrZoidberg
MrZoidberg / makefile
Last active February 2, 2018 11:20
Help command for makefile with colored output
# Needed SHELL since I'm using zsh
SHELL := /bin/bash
.PHONY: help
help: ## This help dialog.
@IFS=$$'\n' ; \
help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##/:/'`); \
printf "%-30s %s\n" "target" "help" ; \
printf "%-30s %s\n" "------" "----" ; \
for help_line in $${help_lines[@]}; do \
@MrZoidberg
MrZoidberg / README.md
Created January 26, 2018 23:35 — forked from rantav/README.md
Find slow queries in mongo DB

A few show tricks to find slow queries in mongodb

Enable profiling

First, you have to enable profiling

> db.setProfilingLevel(1)

Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...