Skip to content

Instantly share code, notes, and snippets.

using System;
using Android.Graphics;
namespace Foo
{
public class BitmapCache
{
DiskCache diskCache;
LRUCache<string, Bitmap> memCache;
@garuma
garuma / Main.axml
Created March 29, 2015 22:00
Cat face with animated vector drawables
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ProgressBar
android:src="@drawable/cat_face_vector"
android:layout_width="192dp"
android:layout_height="192dp"
android:layout_gravity="center"
android:indeterminate="true"
@garuma
garuma / DirectManipulation.cs
Created March 31, 2019 03:15
Basic DirectManipulation binding roughly generated from its IDL file
using System;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
namespace DirectManipulation
{
[Guid ("FBF5D3B4-70C7-4163-9322-5A6F660D6FBC")]
[CoClass (typeof (DirectManipulationManagerClass))]

packages:

  • id: MathNet.Numerics.Core version: 3.17.0
  • id: OxyPlot.Core version: 2.0.0-unstable1013 uti: com.xamarin.workbook id: 744cd41b-7a5b-44a4-b17d-80a4297f0fc3 title: computation-expression platforms:
@garuma
garuma / Program.cs
Created January 15, 2018 23:51
Netduino 3 Wi-Fi OneWire temperature sensor sent over MQTT
using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using System.Threading;
using System.IO;
using System.Net;
using SecretLabs.NETMF.Hardware.Netduino;
using Microsoft.SPOT.Net.NetworkInformation;
using uPLibrary.Networking.M2Mqtt;
@garuma
garuma / JavaApiDiff.cs
Last active September 8, 2016 18:14
A Java API differ using Java.Interop's Xamarin.Android.Tools.Bytecode library
using System;
using System.Linq;
using System.Collections.Generic;
using Xamarin.Android.Tools.Bytecode;
namespace JavaApiDiff
{
class MainClass
{
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@garuma
garuma / Parser.jay
Last active January 13, 2016 19:37
%{
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
namespace MarkdownParser
{
class Counter
{
alias mono='/Users/jeremie/mono/mono/runtime/mono-wrapper'
export MONO_PATH=/Users/jeremie/mono/mono/mcs/class/lib/net_4_5/:$MONO_PATH
alias dmcs='/Users/jeremie/mono/mono/runtime/mono-wrapper /Users/jeremie/mono/mono/mcs/class/lib/net_4_5/dmcs.exe'
alias mcs='/Users/jeremie/mono/mono/runtime/mono-wrapper /Users/jeremie/mono/mono/mcs/class/lib/build/mcs.exe'
alias csharp='/Users/jeremie/mono/mono/runtime/mono-wrapper /Users/jeremie/mono/mono/mcs/class/lib/net_4_5/csharp.exe'
alias xsp='/Users/jeremie/mono/mono/runtime/mono-wrapper /usr/local/lib/mono/4.0/xsp4.exe'
export PS1="[mono master] "$PS1
<?xml version="1.0" encoding="utf-8"?>
<monodroid>
<android-sdk path="/Users/jeremie/mono/android-sdk-macosx" />
<java-sdk path="/usr" />
<android-ndk path="/Users/jeremie/mono/android-ndk-r8" />
</monodroid>