Badge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
mysql: | |
image: mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en-US" style=" | |
height: 100%; | |
"> | |
<body style=" | |
/* width: 400px; */ | |
/* max-height: 400px; */ | |
/* background-color: red; */ | |
overflow: hidden; | |
margin: 0; | |
display: inline-block; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 \ |
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...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import config. | |
# You can change the default config with `make cnf="config_special.env" build` | |
cnf ?= config.env | |
include $(cnf) | |
export $(shell sed 's/=.*//' $(cnf)) | |
# import deploy config | |
# You can change the default deploy config with `make cnf="deploy_special.env" release` | |
dpl ?= deploy.env | |
include $(dpl) |
NewerOlder