Skip to content

Instantly share code, notes, and snippets.

Back to business

Evgeny Zborovsky yuv4ik

Back to business
Block or report user

Report or block yuv4ik

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
yuv4ik / AuthTokenDocumentFilter.cs
Last active Feb 3, 2017
Adding swagger to web.api 2 owin
View AuthTokenDocumentFilter.cs
public class AuthTokenDocumentFilter : IDocumentFilter
public void Apply(SwaggerDocument swaggerDoc, SchemaRegistry schemaRegistry, IApiExplorer apiExplorer)
swaggerDoc.paths.Add("/token", new PathItem
post = new Operation
tags = new List<string> { "Auth" },
consumes = new List<string>
yuv4ik / ViewController.swift
Created Mar 20, 2017
iOS UIDatePicker in UIDatePickerMode.countDownTimer value changed bug
View ViewController.swift
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
// Do any additional setup after loading the view, typically from a nib.
// Create a DatePicker
let datePicker: UIDatePicker = UIDatePicker()
yuv4ik /
Created Apr 28, 2017
git rename a file (case sensitive)
git mv -f OldFileNameCase newFileNameCase
yuv4ik / IEntity.cs
Last active Aug 23, 2017
EntityFramework database first => generalising timestamps
View IEntity.cs
namespace SameNameSpaceAsAutoGeneratedDbContext
public interface IEntity
int Id { get; set; }
DateTime CreatedAt { get; set; }
DateTime? UpdatedAt { get; set; }
DateTime? DeletedAt { get; set; }
yuv4ik / ValidateModelAttribute.cs
Created Aug 23, 2017
Web.API 2 model state validation action filter
View ValidateModelAttribute.cs
using System;
using System.Net;
using System.Net.Http;
using System.Web.Http.Controllers;
using System.Web.Http.Filters;
namespace MyAwesomeWebApi.ActionFilters
/// <summary>
/// Returns 400 if the ModelState is invalid.
yuv4ik /
Last active Dec 27, 2017
[For .NET projects] Recursively find and delete bin, obj and packages directories
# Recursively find and delete "bin", "obj" and "packages" dirs
# Backup your code before using this script, I am not responsible for any data loss. Please use it wisely.
find . -iname "bin" -o -iname "obj" -o -iname "packages" | xargs rm -rf
yuv4ik / Droid.ClipboardService.cs
Created Jan 19, 2018
[Xamarin.Forms] [iOS] [Droid] IClipboardService to read and write text value from the Clipboard
View Droid.ClipboardService.cs
public class ClipboardService : IClipboardService
public string GetTextFromClipboard()
var clipboardmanager = (ClipboardManager)Forms.Context.GetSystemService(Context.ClipboardService);
var item = clipboardmanager.PrimaryClip.GetItemAt(0);
var text = item.Text;
return text;
* First commit any outstanding code changes before executing this command.
* Source:
git rm -r --cached .
git add .
git commit -m "Fix .gitignore by {UPDATE}"
yuv4ik / WebViewWithProgressBar.Droid.cs
Created Feb 25, 2018
Xamarin.Forms WebView with ProgressBar for iOS and Android
View WebViewWithProgressBar.Droid.cs
using Android.Content;
using WebViewWithProgressBar.Droid;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportRenderer(typeof(WebView), typeof(GenericWebViewRenderer))]
namespace WebViewWithProgressBar.Droid
public class GenericWebViewRenderer : WebViewRenderer
yuv4ik / Startup.cs
Created Mar 3, 2018
.NET Standard 2.0 WEB.Api Firebase bearer token validation
View Startup.cs
public class Startup
public Startup(IConfiguration configuration)
Configuration = configuration;
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
You can’t perform that action at this time.