Skip to content

Instantly share code, notes, and snippets.

View heytherewill's full-sized avatar

William Barbosa heytherewill

View GitHub Profile
@heytherewill
heytherewill / polyline.cs
Created February 18, 2016 17:21
Decode a Polyline String in Xamarin.Android
private IEnumerable<LatLng> DecodePolylineString(string encodedPath)
{
var len = encodedPath.Length;
var index = 0;
var lat = 0;
var lng = 0;
while (index < len)
{
var result = 1;

Keybase proof

I hereby claim:

  • I am willsb on github.
  • I am willsb (https://keybase.io/willsb) on keybase.
  • I have a public key ASAD0-tqTDh7fi4cA3M-g-o0vjDnsZKGM20D3B2mERRgxQo

To claim this, I am signing this object:

@heytherewill
heytherewill / Observable.cs
Last active September 2, 2020 11:59
Use the common method names in Rx.Net instead of using the LINQ ones.
using System.Collections.Generic;
using System.Reactive.Concurrency;
using System.Reactive.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace System.Reactive.ApiMappings
{
public static class ObservableEx
{
@heytherewill
heytherewill / NonWovenLoginViewModel.cs
Last active October 24, 2017 21:50
Code snippets for ".NET IL Weaving for those who know nothing about .NET IL Weaving"
namespace NonWoven
{
//BaseViewModel implements INotifyPropertyChanged
public sealed class LoginViewModel : BaseViewModel
{
private bool _isLoading;
public bool IsLoading
{
get => _isLoading;
set
@heytherewill
heytherewill / WovenLoginViewModel.cs
Created October 24, 2017 21:50
Code snippets for ".NET IL Weaving for those who know nothing about .NET IL Weaving"
namespace Woven
{
//BaseViewModel implements INotifyPropertyChanged
public sealed class LoginViewModel : BaseViewModel
{
public bool IsLoading { get; set; }
public string Email { get; set; }
public string Password { get; set; }
@heytherewill
heytherewill / FodyWeavers.xml
Created October 24, 2017 21:52
Code snippets for ".NET IL Weaving for those who know nothing about .NET IL Weaving"
<?xml version="1.0" encoding="utf-8" ?>
<Weavers>
<PropertyChanged />
</Weavers>
private static class MathHelpers
{
public static bool IsEven(int number)
=> number % 2 == 0;
}
private class Tests
{
[Fact]
public void TheEvenMethodReturnsTrueIfTheNumberIsEven()
@heytherewill
heytherewill / .zshrc
Created March 1, 2018 20:52
IL decompiling made simple
function decompile() {
mono /path/to/ILSpyMac.exe -t il $1
}
@heytherewill
heytherewill / WeaverIdeas.cs
Created May 12, 2018 07:26
Weaving made simple
public class WhatIWantToWrite
{
public static void Main(string[] args)
{
System.Console.WriteLine("This I wrote");
}
}
public class WhatIWantToGet
{
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
</Project>