Skip to content

Instantly share code, notes, and snippets.

View felipeslongo's full-sized avatar
🌴
Having Fun With Threads

Felipe de Souza Longo felipeslongo

🌴
Having Fun With Threads
View GitHub Profile
@felipeslongo
felipeslongo / .View
Created March 18, 2019 21:31 — forked from aspnetde/.View
Xamarin.iOS MemoryUtility
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.MessageUI;
using MonoTouch.UIKit;
namespace MyApp
{
public interface ICanCleanUpMyself
{
@felipeslongo
felipeslongo / CustomerController.cs
Created May 24, 2018 04:25 — forked from vkhorikov/CustomerController.cs
Handling failures and input errors in a functional way
[HttpPost]
public HttpResponseMessage CreateCustomer(string name, string billingInfo)
{
Result<BillingInfo> billingInfoResult = BillingInfo.Create(billingInfo);
Result<CustomerName> customerNameResult = CustomerName.Create(name);
return Result.Combine(billingInfoResult, customerNameResult)
.OnSuccess(() => _paymentGateway.ChargeCommission(billingInfoResult.Value))
.OnSuccess(() => new Customer(customerNameResult.Value))
.OnSuccess(
@felipeslongo
felipeslongo / workaround.md
Created April 28, 2018 03:37 — forked from jimmgarrido/workaround.md
Broken Support Library Download Workaround

1. Go to %LOCALAPPDATA%\Xamarin

2. If it doesn't already exist, create a new folder named after the support library NuGet package, e.g. Xamarin.Android.Support.v4

3. Repeat for every support library package in your project:

4. Open the Xamarin Android SDK Manager and download the Android Support Repository (under Tools > Extras):

5. Go to [Android SDK location]\extras\android\m2repository\com\android\support and open the directory for the support library you need

6. Find the correct version and copy the entire folder to directory you created in step 2. The correct version is the one that matches or is nearest to the NuGet package version. For example, if the package version is 23.4.0.1 the support library version would be 23.4.0. If you did not create a folder in

@felipeslongo
felipeslongo / EachDirectoryPath.md
Created March 10, 2018 14:42 — forked from granoeste/EachDirectoryPath.md
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

@felipeslongo
felipeslongo / HtmlBuilder.java
Created February 19, 2018 21:06 — forked from Ilya-Gazman/HtmlBuilder.java
An easy way to work with HTML in Android. Just set the textView with the build result.
public class HtmlBuilder {
public static final String COLOR = "[color]";
public enum Type{
BOLD("strong"),
ITALIC("em"),
COLOR("font color=\"#"+ HtmlBuilder.COLOR + "\""),
SMALL("small")
;
public final String stringType;