Skip to content

Instantly share code, notes, and snippets.

View yuv4ik's full-sized avatar
👨‍💻
Back to business

Evgeny Zborovsky yuv4ik

👨‍💻
Back to business
View GitHub Profile
@yuv4ik
yuv4ik / ExtendedEntry.cs
Created May 5, 2017 13:59
Xamarin.Forms iOS Numeric Keyboard With 'Done' Button
using Xamarin.Forms;
namespace YourNamespace.Controls
{
public class ExtendedEntry : Entry { }
}
@yuv4ik
yuv4ik / ViewController.swift
Created March 20, 2017 07:44
iOS UIDatePicker in UIDatePickerMode.countDownTimer value changed bug
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
// Create a DatePicker
let datePicker: UIDatePicker = UIDatePicker()
@yuv4ik
yuv4ik / macos_catalina_git_branch_terminal.md
Last active March 18, 2022 12:30
macOS Catalina: show git branch in terminal
  • Create a .zshrc file if it does not exist using the next command:
    touch ~/.zshrc
  • Open ~/.zshrc and add the next content:
# git branch
function parse_git_branch() {
    git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/[\1]/p'
}
@yuv4ik
yuv4ik / Droid.ClipboardService.cs
Created January 19, 2018 07:57
[Xamarin.Forms] [iOS] [Droid] IClipboardService to read and write text value from the Clipboard
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;
}
@yuv4ik
yuv4ik / Droid.SettingsHelper.cs
Created May 2, 2018 18:00
[Xamarin.Forms] Open App Settings
public class SettingsHelper
{
public void OpenAppSettings()
{
var intent = new Intent(Android.Provider.Settings.ActionApplicationDetailsSettings);
intent.AddFlags(ActivityFlags.NewTask);
var uri = Android.Net.Uri.FromParts("package", package_name, null);
intent.SetData(uri);
Application.Context.StartActivity(intent);
}
@yuv4ik
yuv4ik / ContentPage.xaml
Last active December 28, 2020 16:52
Xamarin.Forms DatePicker with hours, minutes and seconds: TimeCountdownPicker
/*
Xaml example.
*/
<?xml version="1.0" encoding="utf-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:YourNameSpace"
x:Class="YourNameSpace.ContentPage">
@yuv4ik
yuv4ik / README.md
Last active November 9, 2018 09:14
PCL@.NET Standard
@yuv4ik
yuv4ik / Droid.LabelTextKerningEffect.cs
Last active May 29, 2018 18:21
Xamarin.Forms Android & iOS: LabelTextKerningEffect
using System.Linq;
using System.Text;
using Android.Text;
using Android.Text.Style;
using Android.Widget;
using MyNamespace.Effects;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using static Android.Widget.TextView;
@yuv4ik
yuv4ik / Startup.cs
Created March 3, 2018 00:09
.NET Standard 2.0 WEB.Api Firebase bearer token validation
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.
@yuv4ik
yuv4ik / WebViewWithProgressBar.Droid.cs
Created February 25, 2018 13:27
Xamarin.Forms WebView with ProgressBar for iOS and Android
using Android.Content;
using WebViewWithProgressBar.Droid;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
// https://stackoverflow.com/a/8467430/1970317
[assembly: ExportRenderer(typeof(WebView), typeof(GenericWebViewRenderer))]
namespace WebViewWithProgressBar.Droid
{
public class GenericWebViewRenderer : WebViewRenderer