Skip to content

Instantly share code, notes, and snippets.

Avatar
🧀
Send cheese please

Tomasz Cielecki Cheesebaron

🧀
Send cheese please
View GitHub Profile
@Cheesebaron
Cheesebaron / MvxFixture.cs
Created Mar 24, 2017
MvvmCross xUnit Fixture
View MvxFixture.cs
public class MvxFixture : IDisposable
{
public MvxFixture()
{
MvxTest.Initialize();
}
~MvxFixture()
{
Dispose(false);
View keybase.md

Keybase proof

I hereby claim:

  • I am cheesebaron on github.
  • I am cheesebaron (https://keybase.io/cheesebaron) on keybase.
  • I have a public key ASBnP2BeBE9HsuJU2uWnS0wqLGqsIu08jD_IBEfa9amx2Ao

To claim this, I am signing this object:

View Snackbar.cs
public sealed class Snackbar : UIView
{
public TimeSpan Duration { get; set; }
public Action<Snackbar> OnAction { get; set; }
public Action<Snackbar> OnDismiss { get; set; }
private static Snackbar _currentlyVisibleSnackbar;
private readonly UILabel _messageLabel;
private readonly UIButton _actionButton;
private readonly UIView _separator;
private NSLayoutConstraint[] _horizontalLayoutConstraints;
@Cheesebaron
Cheesebaron / CircleView.cs
Last active Nov 29, 2015
Waves represented by circles! See gfycat here: http://gfycat.com/AfraidRequiredEsok
View CircleView.cs
using System;
using Android.Content;
using Android.Graphics;
using Android.Runtime;
using Android.Util;
using Android.Views;
namespace CircleWaves
{
public class CircleView : View
@Cheesebaron
Cheesebaron / CaptureUiElements.cs
Created Aug 25, 2015
Capture UI elements Windows
View CaptureUiElements.cs
protected async Task<RenderTargetBitmap> CaptureUiElementToStreamAsync(FrameworkElement uiElement,
IRandomAccessStream stream)
{
return await CaptureUiElementToStreamAsync(uiElement, stream, BitmapEncoder.PngEncoderId);
}
private async Task<RenderTargetBitmap> CaptureUiElementToStreamAsync(FrameworkElement uiElement,
IRandomAccessStream stream, Guid encoderId)
{
if (uiElement == null) throw new ArgumentNullException(nameof(uiElement));
@Cheesebaron
Cheesebaron / DeviceInfo.cs
Last active Aug 29, 2015
Year classification for Android. Based on Facebook's device-year-class: https://github.com/facebook/device-year-class
View DeviceInfo.cs
using System;
using System.IO;
using System.Linq;
using Android.OS;
using Android.Util;
namespace DeviceYearClass
{
public class DeviceInfo
{
View ColorUtils.cs
public static class ColorUtils
{
public static class LabConstants
{
public const int Kn = 18;
public const float Xn = 0.950470f;
public const float Yn = 1f;
public const float Zn = 1.088830f;
@Cheesebaron
Cheesebaron / CircularProgressDrawable.cs
Created Jul 9, 2015
CircularProgressDrawable, based on castorflex's Java implementation here: https://gist.github.com/castorflex/4e46a9dc2c3a4245a28e
View CircularProgressDrawable.cs
[Register("dk.ostebaronen.droid.CircularProgressDrawable")]
public class CircularProgressDrawable
: Drawable
, IAnimatable
{
private static readonly IInterpolator AngleInterpolator = new LinearInterpolator();
private static readonly IInterpolator SweepInterpolator = new DecelerateInterpolator();
private static readonly RectF _bounds = new RectF();
private const int AngleAnimatorDuration = 2000;
View DoomRandom.cs
/*
* C# derivative of m_random.c used in DOOM
* https://github.com/id-Software/DOOM/blob/master/linuxdoom-1.10/m_random.c
*
* Copyright (C) 1993-1996 by id Software, Inc.
*
* This source is available for distribution and/or modification
* only under the terms of the DOOM Source Code License as
* published by id Software. All rights reserved.
*