Skip to content

Instantly share code, notes, and snippets.

View jzeferino's full-sized avatar
:octocat:
󠀡

jzeferino jzeferino

:octocat:
󠀡
View GitHub Profile
@jzeferino
jzeferino / Animation Fade
Created October 11, 2018 16:04 — forked from aloisdeniel/Animation Fade
Xamarin.iOS view common animations
public static void Fade (this UIView view, bool isIn, double duration = 0.3, Action onFinished = null)
{
var minAlpha = (nfloat)0.0f;
var maxAlpha = (nfloat)1.0f;
view.Alpha = isIn ? minAlpha : maxAlpha;
view.Transform = CGAffineTransform.MakeIdentity ();
UIView.Animate (duration, 0, UIViewAnimationOptions.CurveEaseInOut,
() => {
view.Alpha = isIn ? maxAlpha : minAlpha;
@jzeferino
jzeferino / Logger.cs
Created February 1, 2018 09:45 — forked from ankitvijay/Logger.cs
CallerInfoExample
using System.Diagnostics;
using System.Runtime.CompilerServices;
namespace CallerInfoExample
{
public static class Logger
{
public static void Log(string message,
[CallerFilePath] string sourceFilePath = "",
[CallerLineNumber] int sourceLineNumber = 0,
@jzeferino
jzeferino / RvUtil.cs
Created January 4, 2018 15:39 — forked from Redth/RvUtil.cs
public class RvUtil
{
public RvUtil (RecyclerView rv)
{
recyclerView = rv;
}
RecyclerView recyclerView;
IntPtr id_setNestedScrollingEnabled;
@jzeferino
jzeferino / Async.cake
Created July 9, 2017 19:00 — forked from devlead/Async.cake
Sample of using async await in a cake script using a AsyncHelper class to work with all async scenarios, currently needs "--Experimental" flag or to use the Cake.CoreCLR runner as a newer version of Roslyn is required for async to be recognized. Example invocation: cake .\AsyncHelper.cake -Experimental
#load "AsyncHelper.cake"
#r "System.Net.Http"
using System.Net.Http;
using System.Net.Http.Headers;
string url = "https://icanhazdadjoke.com/";
var result = AsyncHelpers.RunSync(
async ()=> {
using(var client = new HttpClient())
@jzeferino
jzeferino / Async.cake
Created July 9, 2017 19:00 — forked from devlead/Async.cake
Sample of using async await in a cake script using a AsyncHelper class to work with all async scenarios, currently needs "--Experimental" flag or to use the Cake.CoreCLR runner as a newer version of Roslyn is required for async to be recognized. Example invocation: cake .\AsyncHelper.cake -Experimental
#load "AsyncHelper.cake"
#r "System.Net.Http"
using System.Net.Http;
using System.Net.Http.Headers;
string url = "https://icanhazdadjoke.com/";
var result = AsyncHelpers.RunSync(
async ()=> {
using(var client = new HttpClient())
@jzeferino
jzeferino / build.gradle
Created April 13, 2017 15:26 — forked from alexsinger/build.gradle
Separate Crashlytics reporting for debug and release buildTypes using a Gradle build
// The following code allows an app to report Crashlytics crashes separately
// for release and debug buildTypes when using Gradle. This code should be inserted
// into the specified locations within your build.gradle (Module:app) file
// The buildTypes { } block should be inserted inside the android { } block
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ext.crashlyticsApiSecret = "release api secret"
@jzeferino
jzeferino / build.gradle
Created April 13, 2017 15:26 — forked from alexsinger/build.gradle
Separate Crashlytics reporting for debug and release buildTypes using a Gradle build
// The following code allows an app to report Crashlytics crashes separately
// for release and debug buildTypes when using Gradle. This code should be inserted
// into the specified locations within your build.gradle (Module:app) file
// The buildTypes { } block should be inserted inside the android { } block
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ext.crashlyticsApiSecret = "release api secret"
@jzeferino
jzeferino / gist:40fd1f882e7ee6a03325ac1a0138a507
Created March 4, 2017 11:58 — forked from lontivero/gist:593fc51f1208555112e0
Generates Markdown from VS XML documentation file
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Xml;
using System.Xml.Linq;
namespace GithubWikiDoc
{
@jzeferino
jzeferino / gist:6e8fe5660cdad6e62cf9e879028858d1
Created November 4, 2016 15:07 — forked from snikch/gist:3661188
Find the current top view controller for your iOS application
- (UIViewController *)topViewController{
return [self topViewController:[UIApplication sharedApplication].keyWindow.rootViewController];
}
- (UIViewController *)topViewController:(UIViewController *)rootViewController
{
if (rootViewController.presentedViewController == nil) {
return rootViewController;
}
@jzeferino
jzeferino / InvariantUrlParameterFormatter.cs
Last active August 27, 2016 09:31 — forked from ncruces/InvariantUrlParameterFormatter.cs
Culture invariant IUrlParameterFormatter for Refit
using System;
using System.Globalization;
using System.Reflection;
namespace Refit
{
public sealed class InvariantUrlParameterFormatter : IUrlParameterFormatter
{
public string Format(object parameterValue, ParameterInfo parameterInfo)
{