Skip to content

Instantly share code, notes, and snippets.

Aimoré Sá Costa aimore

Block or report user

Report or block aimore

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@aimore
aimore / exception.txt
Created Sep 9, 2019
Exception Android binding
View exception.txt
Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
at Xamarin.Android.Tools.ApiXmlAdjuster.JavaApiXmlGeneratorExtensions.Save (Xamarin.Android.Tools.ApiXmlAdjuster.JavaTypeParameters typeParameters, System.Xml.XmlWriter writer, System.String indent) [0x000f0] in <c382107dedd843d887cb116e53359071>:0
at Xamarin.Android.Tools.ApiXmlAdjuster.JavaApiXmlGeneratorExtensions.SaveCommon (Xamarin.Android.Tools.ApiXmlAdjuster.JavaMember m, System.Xml.XmlWriter writer, System.String elementName, System.String abs, System.String native, System.String ret, System.String sync, System.String transient, System.String type, System.String typeGeneric, System.String value, System.String volat, Xamarin.Android.Tools.ApiXmlAdjuster.JavaTypeParameters typeParameters, System.Collections.Generic.IEnumerable`1[T] parameters, System.Collections.Generic.IEnumerable`1[T] exceptions, System.Nullable`1[T] extBridge, System.String jniReturn, System.Nullable`1[T] extSyn
View HomeContent.json
{
"home": {
"promoCards": [
{
"title": "Lecker Burger",
"address": "Cheesy pizza 30% off and you get a second free",
"image": "https://d3i4yxtzktqr9n.cloudfront.net/web-eats/static/images/homepage/burger-image-550-0f1a479683.png",
"rigthWidget": "OPEN",
"leftWidget": "4.5"
},
@aimore
aimore / strings.json
Last active Jun 30, 2019
XamFood Strings Json
View strings.json
{
"appName": "Joe's",
"isPremium": false,
"styles": {
"backgroundColor": "#fefcfa",
"promoTitleColor": "#1b1b1b",
"tabBarColor": "#fefcfa",
"categoryTitleColor": "#fefcfa",
"descriptionColor": "",
"rightWidgetColor": "",
@aimore
aimore / IdentityServerHelper.swift
Last active Jun 7, 2019
IdentityServer4 helper for swift 4
View IdentityServerHelper.swift
//
// IdentityServerHelper.swift
// Example
//
// Aimore Sa on 5/6/19.
//
import Foundation
import AppAuth
@aimore
aimore / extension.cs
Created May 30, 2019
Image source extension xamarin
View extension.cs
[ContentProperty(nameof(Source))]
public class ImageResourceExtension : IMarkupExtension
{
public string Source { get; set; }
public object ProvideValue(IServiceProvider serviceProvider)
{
if (Source == null)
{
return null;
View PdfConverteriOS.cs
using System;
using System.Drawing;
using System.IO;
using CatCatalog.iOS.Services;
using CatCatalog.Services;
using CoreGraphics;
using Foundation;
using UIKit;
using Xamarin.Forms;
@aimore
aimore / OAuth2AuthenticatorEx.cs
Created Feb 4, 2019
Xamarin.Auth "Authentication Error: Invalid state from server. Possible forgery!" workaround
View OAuth2AuthenticatorEx.cs
public class OAuth2AuthenticatorEx : OAuth2Authenticator
{
protected override void OnPageEncountered(Uri url, IDictionary<string, string> query, IDictionary<string, string> fragment)
{
// Remove state from dictionaries.
// We are ignoring request state forgery status
// as we're hitting an ASP.NET service which forwards
// to a third-party OAuth service itself
if (query.ContainsKey("state"))
{
@aimore
aimore / SignatureCheck.cs
Last active Sep 28, 2018
Android signature security validation for Xamarin.Android
View SignatureCheck.cs
public bool ValidateAppSignature(Android.Content.Context context)
{
PackageInfo packageInfo = context.PackageManager.GetPackageInfo(context.PackageName, PackageInfoFlags.Signatures);
//note sample just checks the first signature
foreach (Signature signature in packageInfo.Signatures) {
// SHA1 the signature
String sha1 = GetSHA1(signature.ToByteArray());
// check is matches hardcoded value
return APP_SIGNATURE.Equals(sha1);
@aimore
aimore / WhiteCard.doc
Last active Apr 8, 2018
White Card Exam
View WhiteCard.doc
Areas Abbreviation Capital
New South Wales NSW Sydney
Queensland QLD Brisbane
South Australia SA Adelaide
Tasmania TAS Hobart
Victoria VIC Melbourne
Western Australia WA Perth
► Work Health and Safety Act 2011
View Leaflet.Instagram.Cluster.js
/*! Leaflet.Instagram 2014-06-26 */
L.Instagram = L.FeatureGroup.extend({
options: {
icon: {
iconSize: [40, 40],
className: "leaflet-marker-instagram"
},
popup: {
className: "leaflet-popup-instagram"
},
You can’t perform that action at this time.