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
| # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. | |
| # Initialization code that may require console input (password prompts, [y/n] | |
| # confirmations, etc.) must go above this block, everything else may go below. | |
| if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then | |
| source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" | |
| fi | |
| # If you come from bash you might have to change your $PATH. | |
| # export PATH=$HOME/bin:/usr/local/bin:$PATH |
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
| package com.jivimberg.sqs.published | |
| import kotlinx.coroutines.CancellationException | |
| import kotlinx.coroutines.CoroutineScope | |
| import kotlinx.coroutines.isActive | |
| import kotlinx.coroutines.yield | |
| import java.lang.Thread.currentThread | |
| suspend fun CoroutineScope.repeatUntilCancelled(block: suspend () -> Unit) { | |
| while (isActive) { |
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
| /** | |
| * Find the longest class names in Spring. | |
| * Also find FactoryFactory classes. | |
| * a goof-off project by @thom_nic | |
| */ | |
| import java.util.jar.* | |
| defaultTasks 'longest', 'factoryfactory' |
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
| const waitFor = (ms) => new Promise(r => setTimeout(r, ms)) | |
| const asyncForEach = (array, callback) => { | |
| for (let index = 0; index < array.length; index++) { | |
| await callback(array[index], index, array) | |
| } | |
| } | |
| const start = async () => { | |
| await asyncForEach([1, 2, 3], async (num) => { | |
| await waitFor(50) |
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 sealed class ItemHashPairCacheService : IItemHashPairCacheService | |
| { | |
| private readonly ICacheClient _cacheClient; | |
| private readonly ILogger<ItemHashPairCacheService> _logger; | |
| private static readonly TimeSpan CacheExpiry = TimeSpan.FromDays(30); | |
| public ItemHashPairCacheService(ICacheClient cacheClient, ILogger<ItemHashPairCacheService> logger) | |
| { | |
| _cacheClient = cacheClient ?? throw new ArgumentNullException(nameof(cacheClient)); | |
| _logger = logger ?? throw new ArgumentNullException(nameof(logger)); |