Skip to content

Instantly share code, notes, and snippets.

View aimore's full-sized avatar
🏠
Working from home

Aimoré aimore

🏠
Working from home
View GitHub Profile
@aimore
aimore / OAuth2AuthenticatorEx.cs
Created February 4, 2019 01:49
Xamarin.Auth "Authentication Error: Invalid state from server. Possible forgery!" workaround
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 September 28, 2018 04:47
Android signature security validation for Xamarin.Android
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 December 1, 2023 01:59
White Card Exam
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
/*! Leaflet.Instagram 2014-06-26 */
L.Instagram = L.FeatureGroup.extend({
options: {
icon: {
iconSize: [40, 40],
className: "leaflet-marker-instagram"
},
popup: {
className: "leaflet-popup-instagram"
},
/*
Leaflet.markercluster, Provides Beautiful Animated Marker Clustering functionality for Leaflet, a JS library for interactive maps.
https://github.com/Leaflet/Leaflet.markercluster
(c) 2012-2013, Dave Leaver, smartrak
*/
! function(t, e) {
L.MarkerClusterGroup = L.FeatureGroup.extend({
options: {
maxClusterRadius: 80,
iconCreateFunction: null,
html, body, #map {
margin: 0; height: 100%; background: #fff;
}
Skip to content
This repository
Search
Pull requests
Issues
Marketplace
Explore
@aimore
Sign out
6
using System;
using UIKit;
using CoreGraphics;
using CoreAnimation;
namespace Coverflow
{
public class CoverFlowLayout : UICollectionViewFlowLayout
{
private const int ACTIVE_DISTANCE = 200;
@aimore
aimore / ViewController.swift
Created June 20, 2016 17:46
BullsEye game created with Swift
//
// ViewController.swift
// BullsEye
//
// Created by Aimoré Sá on 17.11.15.
// Copyright © 2015 Aimoré Sá. All rights reserved.
//
import UIKit
@aimore
aimore / codecommuntiy.swift
Last active June 21, 2016 10:48
Swift basics ( 1 swift meetup)
//: Swift meetup 15:03.1026
import Cocoa
/*var int: Int=3
print(int)
var letter: [String] = ["a", "b", "c", "d", "e"]