Skip to content

Instantly share code, notes, and snippets.

View wcoder's full-sized avatar
🎯
Focusing

Yauheni Pakala wcoder

🎯
Focusing
View GitHub Profile
// (c) 2017 Yauheni Pakala
(function(p,l){l.protocol===p||(l.protocol=p)}("https:",window.location))
@wcoder
wcoder / xamarin_android.md
Last active January 29, 2018 21:10
Exception handling on Xamarin Android
// Wire up Unhandled Expcetion handler from Android
AndroidEnvironment.UnhandledExceptionRaiser += (sender, args) =>
{
	/*
	 * When the UI Thread crashes this is the code that will be executed. There is no context at this point
	 * and no way to recover from the exception. This is where you would capture the error and log it to a 
	 * file for example. You might be able to post to a web handler, I have not tried that.
	 * 
@wcoder
wcoder / multiple-rename.md
Last active January 29, 2018 21:08
Multiple files renaming on macOS
for j in *.bak; do mv -- "$j" "temp_${j%.bak}.txt"; done

Example:

from:
123.bak
@wcoder
wcoder / ViewPagerIndicator.cs
Last active July 14, 2021 15:37
Basic implementation of ViewPager indicator
public class ViewPagerIndicator : LinearLayout, ViewPager.IOnPageChangeListener
{
private TextView _textView;
private ViewPager _viewPager;
#region Android view dafault constructors
public ViewPagerIndicator(Context context)
: base(context)
{
@wcoder
wcoder / parseInt.js
Last active September 23, 2017 13:35
// (c) 2016 Yauheni Pakala
var _parseInt = str => str.replace(/(.*?)(\d+)(.*)/,'$2') - 0;
// test
console.log(_parseInt("123hui"));
console.log(_parseInt("123hui321"));
console.log(_parseInt("hui123"));
public class CarouselIndicators : Grid
{
private ImageSource UnselectedImageSource = null;
private ImageSource SelectedImageSource = null;
private readonly StackLayout _indicators = new StackLayout() { Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.CenterAndExpand };
public CarouselIndicators()
{
this.HorizontalOptions = LayoutOptions.CenterAndExpand;
this.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
public class BaseViewModel : BaseNotify
{
bool _isBusy = false;
CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
public bool IsBusy
{
get
{
return _isBusy;
@wcoder
wcoder / IRemove.cs
Last active February 27, 2016 20:15 — forked from jamesmontemagno/IRemove.cs
A simple and Intuitive Xamarin.iOS + MvvmCross TableView swipe to delete implementation. This will allow you to have any number of ViewModels simply implement IRemove.cs and all you need is MvxDeleteStandarTableViewSource and implement the interface in your viewmodels! I should say that these are edited classes, you should implement some of the …
public interface IRemove
{
ICommand RemoveCommand { get; }
}
@wcoder
wcoder / nodeapp.conf
Created January 17, 2016 17:03
unstart config (/etc/init/) for run node.js app as the service
description "node.js server"
author "Yuaheni Pakala"
# used to be: start on startup
# until we found some mounts weren't ready yet while booting:
start on started mountall
stop on shutdown
# Automatically Respawn:
respawn
@wcoder
wcoder / ios-dist.txt
Created December 30, 2015 20:21
Link for iOS distribution
itms-services://?action=download-manifest&url=http://loqi.me/app/Geoloqi.plist
From: http://aaronparecki.com/articles/2011/01/21/1/how-to-distribute-your-ios-apps-over-the-air