Skip to content

Instantly share code, notes, and snippets.

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

jzeferino jzeferino

:octocat:
󠀡
View GitHub Profile
@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 / SuffixEditText
Last active February 7, 2018 15:42
Edit text with suffix
using Android.Content;
using Android.Util;
using Android.Widget;
using Android.Runtime;
using System;
using Android.Text;
namespace Utils
{
public class SuffixEditText : EditText
@jzeferino
jzeferino / DrawerMenuCustomFontHack.java
Created November 5, 2016 13:00
Hack custom font in drawer menu with calligraphy
public class MainActivity extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
@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;
}
<StyleCopSettings Version="4.3">
<GlobalSettings>
<CollectionProperty Name="DeprecatedWords">
<Value>preprocessor,pre-processor</Value>
<Value>shortlived,short-lived</Value>
</CollectionProperty>
</GlobalSettings>
<Parsers>
<Parser ParserId="StyleCop.CSharp.CsParser">
<ParserSettings>
@jzeferino
jzeferino / LocalJsonLoader.cs
Created October 23, 2016 20:27
Load T from resources Xamarin - Note: mark file build action as embedresource
using System;
using System.IO;
using System.Reflection;
using Newtonsoft.Json;
using System.Linq;
using System.Runtime.InteropServices.ComTypes;
namespace jzeferino.gist
{
public static class LocalJsonLoader
@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)
{