Skip to content

Instantly share code, notes, and snippets.

View ewancoder's full-sized avatar

Ivan Zyranau ewancoder

  • Exadel
  • Minsk, Belarus
View GitHub Profile
@ewancoder
ewancoder / ValueTaskHelpers.cs
Created April 30, 2020 16:54
ValueTask WhenAll support
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace TypingRealm.Common
{
public static class ValueTaskExtensions
{
public static async ValueTask WhenAll(this IEnumerable<ValueTask> valueTasks)
{
@ewancoder
ewancoder / TaskExtensions.cs
Created April 30, 2020 16:54
Task cancellation support (using timeouts)
using System.Threading;
using System.Threading.Tasks;
namespace TypingRealm.Common
{
public static class TaskExtensions
{
public static async Task WithCancellation(this Task task, CancellationToken cancellationToken)
{
using var localCts = new CancellationTokenSource();
@ewancoder
ewancoder / ServiceCollectionExtensions.cs
Last active April 19, 2021 14:08
Decorator for .NET Core DI
using System;
using System.Linq;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
namespace TypingRealm.Common
{
public static class ServiceCollectionExtensions
{
public static void Decorate<TInterface, TDecorator>(this IServiceCollection services)
cd /d/Dropbox/Work/Audit/Audit
#=== GitBlit ===
function tiupdate {
ticket=`git branch -lvv | grep \* | grep origin/ticket | cut -d '[' -f2 | cut -d ']' -f1 | cut -d '/' -f2- | cut -d ':' -f1`
branch=`git branch | grep \* | awk '{print $2}'`
#===== GIT CONFIGURATION =====
remote=origin
@ewancoder
ewancoder / curses-log (June-18-2015)
Created June 18, 2015 13:15
Problem with colors in canto-curses.
16:10:33 : CANTO-CURSES -> canto-curses 0.9.3 gc1ed61e
16:10:33 : CANTO-CURSES -> Version check passed: 0.9
16:10:33 : CONFIG -> color.selected must be >= 0 and <= 255 (-1)
16:10:33 : CONFIG -> config color was bad ({'selected': -1, '126': 125, '105': 104, '102': 101, '16': 15, '201': 200, '88': 87, '227': 226, '29': 28, '151': 150, '199': 198, '182': 181, '187': 186, '159': 158, '188': 187, '197': 196, '216': 215, '55': 54, '87': 86, '225': 224, '177': 176, '243': 242, '61': 60, '156': 155, '48': 47, '2': 1, '64': 63, '92': 91, '123': 122, '124': 123, '9': 8, '239': 238, '56': 55, '127': 126, '80': 79, '68': 67, 'reader_quote': 6, '250': 249, '230': 229, '78': 77, '99': 98, '62': 61, '67': 66, '81': 80, '204': 203, '173': 172, '207': 206, '25': 24, '23': 22, '192': 191, '244': 243, '44': 43, '221': 220, '52': 51, '213': 212, 'reader_link': 3, '161': 160, '198': 197, '49': 48, '65': 64, '113': 112, 'error': 2, '155': 154, '93': 92, '114': 113, '240': 239, '60': 59, '256': 255, '255': 254, '210': 209, '194': 1
@ewancoder
ewancoder / CSS
Created January 20, 2015 08:27
cVim CSS
#cVim-link-container, .cVim-link-hint, #cVim-command-bar, #cVim-command-bar-mode, #cVim-command-bar-input, #cVim-command-bar-search-results, .cVim-completion-item, .cVim-completion-item .cVim-full, .cVim-completion-item .cVim-left, .cVim-completion-item .cVim-right, #cVim-hud, #cVim-status-bar {
font-family: Showcard Gothic, Helvetica, Helvetica Neue, Neue, sans-serif, monospace, Arial;
font-size: 8pt !important;
-webkit-font-smoothing: antialiased !important;
}
#cVim-link-container {
position: absolute;
pointer-events: none;
width: 100%; left: 0;
@ewancoder
ewancoder / cVimrc
Last active August 29, 2015 14:13
cVim settings
let hintcharacters = "asdfgqwerzxcb"
set cncpcompletion
let mapleader = ","
let searchengine kinopoisk = "http://www.google.com/search?q=kinopoisk+%s"
let searchengine define = "http://www.google.com/search?q=define+%s"
let searchengine reference = "http://dictionary.reference.com/browse/%s?s=t"
let searchengine image = "http://www.google.by/search?q=%s&source=lnms&tbm=isch&sa=X&ei=S2y3VLyuIvKM7AbIk4GoDg&ved=0CAgQ_AUoAQ&biw=842&bih=739"
let searchengine translate = "http://translate.google.com/#en/ru/%s"
let completionengines = ["google", "wikipedia"]
let searchalias k = "kinopoisk"