Skip to content

Instantly share code, notes, and snippets.

View vackup's full-sized avatar

Hernan Zaldivar vackup

View GitHub Profile
### Keybase proof
I hereby claim:
* I am vackup on github.
* I am vackup (https://keybase.io/vackup) on keybase.
* I have a public key ASB_FgWLigQntL1k0_cMI7FAOUfRKIx9EHBkAHZZ21Wj-go
// an abstract helper class
public abstract class MvxAnnotationManager
{
private readonly MKMapView _mapView;
private IEnumerable _itemsSource;
private IDisposable _subscription;
public Dictionary<object, MKAnnotation> _annotations = new Dictionary<object, MKAnnotation>();
protected MvxAnnotationManager(MKMapView mapView)
{
public abstract class ViewModelBase : MvxViewModel
{
protected void ClearStackAndShowViewModel<TViewModel>()
where TViewModel : ViewModelBase
{
var presentationBundle = new MvxBundle(new Dictionary<string, string> { { PresentationBundleFlagKeys.ClearStack, "" } });
ShowViewModel<TViewModel>(presentationBundle: presentationBundle);
}
}
@vackup
vackup / CustomUIBarButtonItem.cs
Created September 22, 2016 14:15 — forked from pierceboggan/CustomUIBarButtonItem.cs
Shows off using a UIButton with a background image as a UIBarButtonItem, and handling touch events accordingly.
var composeButton = new UIButton (new RectangleF (0, 0, 20, 20));
composeButton.SetBackgroundImage (Images.ComposeButton, UIControlState.Normal);
composeButton.SetBackgroundImage (Images.ComposeButtonHighlighted, UIControlState.Highlighted);
composeButton.AddTarget((object sender, EventArgs args) => PresentViewController (new PrayerComposeDialog (), true, null),
UIControlEvent.TouchUpInside);
ComposeButton = new UIBarButtonItem (composeButton);
NavigationItem.RightBarButtonItem = ComposeButton;
@vackup
vackup / TextMeter.cs
Created September 22, 2016 14:15 — forked from rudyryk/TextMeter.cs
C# — Measure string size in Xamarin.Forms for iOS and Android platforms
//
// TextMeter.cs
// Created by Alexey Kinev on 11 Feb 2015.
//
// Licensed under The MIT License (MIT)
// http://opensource.org/licenses/MIT
//
// Copyright (c) 2015 Alexey Kinev <alexey.rudy@gmail.com>
//
// Usage example:
@vackup
vackup / Animation Fade
Created September 20, 2016 02:43 — 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;
@vackup
vackup / Creating Shazam in Java
Created September 13, 2016 01:24 — forked from mort/Creating Shazam in Java
Creating Shazam in Java
A backup of http://sites.google.com/site/redcodenl/creating-shazam-in-java-1 just in case
Why is this necessary? Read http://sites.google.com/site/redcodenl/patent-infringement
Please fork, tweet about, etc.
----
Creating Shazam in Java
A couple of days ago I encountered this article: How Shazam Works
This got me interested in how a program like Shazam works… And more importantly, how hard is it to program something similar in Java?

SVG Animated Guitar (Play Me!)

Rock out with this interactive svg animation, click, tap, or any key to play! Part of my Pen's of Rock! collection. Drawn in adobe illustrator, animated with greensock's svg morph plugin. Turn your speakers up for html audio elements in your ears! Took a lot of inspiration from @chrisgannon for animation. Just to be clear - I recorded the guitar, however I didn't write "Smoke on the Water"... Weird bounding box appears when tapped on mobile, any ideas?

Forked from Josh's Pen SVG Animated Guitar (Play Me!).

A Pen by Hernan Zaldivar on CodePen.

License.

using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
namespace ODataMobile