This file contains hidden or 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 async Task<List<Post>> GetPostsAsync(string userId = null, PaginationFilter paginationFilter = null) | |
| { | |
| var queryable = _dataContext.Posts.AsQueryable(); | |
| if (paginationFilter == null) | |
| { | |
| return await queryable.Include(x => x.Tags).ToListAsync(); | |
| } | |
| if (!string.IsNullOrEmpty(userId)) |
This file contains hidden or 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 async Task<IActionResult> GetAll([FromQuery] string userId, [FromQuery]PaginationQuery paginationQuery) | |
| { | |
| ... | |
| var posts = await _postService.GetPostsAsync(userId, pagination); | |
| ... | |
| } |
This file contains hidden or 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
| CPU - https://www.skroutz.gr/s/14650951/AMD-Ryzen-7-2700-Box.html | |
| GPU - https://www.skroutz.gr/s/16765609/Sapphire-Radeon-RX-590-8GB-Nitro-Special-Edition-11289-01.html | |
| MOBO - https://www.skroutz.gr/s/15598771/Asrock-Fatal1ty-B450-Gaming-K4.html | |
| RAM - https://www.skroutz.gr/s/7730092/G-Skill-RipjawsV-16GB-DDR4-3200MHz-F4-3200C16D-16GVKB.html | |
| PSU - https://www.skroutz.gr/s/11452924/Corsair-TX-M-Series-TX650M.html | |
| SSD - https://www.skroutz.gr/s/13867020/Samsung-860-Evo-500GB.html | |
| HDD - https://www.skroutz.gr/s/7602220/Western-Digital-Blue-3-5-2TB.html | |
| CASE - DIALEKSE (Na yposthrizei ATX) - https://www.skroutz.gr/c/28/cases-koutia.html?o=full+tower&order_by=popularity&order_dir=desc&price_max=50&price_min=30 | |
| MONITOR - DIALEKSE https://www.skroutz.gr/s/14310220/Acer-KG271U.html |
This file contains hidden or 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
| { | |
| "username": "crawler", | |
| "content": "crawler[twitter] -- Status Update\nThis is a test", | |
| "embeds": [{ | |
| "title": "Test embedding", | |
| "description": "you dont need a description but whatever", | |
| "url": "https://github.com", | |
| }] | |
| } |
This file contains hidden or 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 cirq | |
| from cirq.ops import CNOT, H, T, S, ZPowGate | |
| # the actual matrix you could get: T_DAG = np.matrix.getH(cirq.unitary(cirq.ops.T)) | |
| # but cirq works with ops | |
| # from the definition | |
| # actual T is defined as exponent=0.25 | |
| T_DAG = ZPowGate(exponent=-0.25) | |
This file contains hidden or 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 RedisHealthCheck : IHealthCheck | |
| { | |
| private readonly IConnectionMultiplexer _connectionMultiplexer; | |
| public RedisHealthCheck(IConnectionMultiplexer connectionMultiplexer) | |
| { | |
| _connectionMultiplexer = connectionMultiplexer; | |
| } | |
| public Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = new CancellationToken()) |
This file contains hidden or 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
| app.UseHealthChecks("/health", new HealthCheckOptions | |
| { | |
| ResponseWriter = async (context, report) => | |
| { | |
| context.Response.ContentType = "application/json"; | |
| var response = new HealthCheckResponse | |
| { | |
| Status = report.Status.ToString(), | |
| Checks = report.Entries.Select(x => new HealthCheck |
This file contains hidden or 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 HealthCheck | |
| { | |
| public string Status { get; set; } | |
| public string Component { get; set; } | |
| public string Description { get; set; } | |
| } |
This file contains hidden or 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 HealthCheckResponse | |
| { | |
| public string Status { get; set; } | |
| public IEnumerable<HealthCheck> Checks { get; set; } | |
| public TimeSpan Duration { get; set; } // Duration that the checks took to complete | |
| } |
This file contains hidden or 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
| services.AddSingleton<IUriService>(provider => | |
| { | |
| var accessor = provider.GetRequiredService<IHttpContextAccessor>(); | |
| var request = accessor.HttpContext.Request; | |
| var absoluteUri = string.Concat(request.Scheme, "://", request.Host.ToUriComponent(), "/"); | |
| return new UriService(absoluteUri); | |
| }); |