Skip to content

Instantly share code, notes, and snippets.

View pragmatrix's full-sized avatar

Armin pragmatrix

View GitHub Profile
@pragmatrix
pragmatrix / ValueOrException.cs
Last active August 29, 2015 14:02
ValueOrExeption
// see https://gist.github.com/mausch/2ef2e9b26a89d7594e3d
public struct ValueOrException<TValue>
{
public ValueOrException(TValue value, Exception exception)
{
_value = value;
_exception = exception;
}
@pragmatrix
pragmatrix / CreateArrowPath.cs
Last active December 22, 2015 02:49
iOS arrow drawing code, ported to MonoTouch / C# from https://gist.github.com/mayoff/4146780
using System;
using System.Drawing;
using MonoTouch.CoreGraphics;
/// https://gist.github.com/mayoff/4146780
static class ArrowPath
{
public static CGPath pathWithArrowFromPoint(
PointF startPoint,
#!/bin/bash
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete.
# Example: git-delete-history path1 path2
if [ $# -eq 0 ]; then
public interface ISet<ItemT>
{
void Add(ItemT item);
void Remove(ItemT item);
bool Contains(ItemT item);
IEnumerable<ItemT> Items { get; }
int Count { get; }
}
@pragmatrix
pragmatrix / PhotoExportService.cs
Created September 9, 2012 17:55
ALAssetsLibrary: export to group for MonoTouch, tested on iOS 5.1 - iOS 8.0.2
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using MonoTouch.UIKit;
using MonoTouch.AssetsLibrary;
using MonoTouch.Foundation;
namespace LookHere.Exporting
@pragmatrix
pragmatrix / VirtualKeyHelper.cs
Created August 5, 2012 16:01
(unfinished) Helper to convert WinRT Virtual Keys to ASCII
using System.Diagnostics;
using Windows.System;
namespace Toolbox.WinRT
{
enum VKeyClass
{
Control, // 0-31, 33-47, 91-95, 144-165
Character, // 32, 48-90
NumPad, // 96-111