Skip to content

Instantly share code, notes, and snippets.

View jonathanpeppers's full-sized avatar
🌶️
spicy!

Jonathan Peppers jonathanpeppers

🌶️
spicy!
View GitHub Profile
@jonathanpeppers
jonathanpeppers / gist:3407041
Created August 20, 2012 19:35
Execute for Xactware
using System;
using System.Threading;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace XactwareExample
{
public static class Execute
{
public static void OnBackgroundThread(NSAction backgroundAction, NSAction uiAction)
@jonathanpeppers
jonathanpeppers / gist:3410581
Created August 21, 2012 02:02
Project include
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<WildCard Include="..\..\..\..\Assets\Fonts\*.spritefont">
<Link>%(FileName).spritefont</Link>
<Importer>FontDescriptionImporter</Importer>
<Processor>FontDescriptionProcessor</Processor>
</WildCard>
</ItemGroup>
<ItemGroup>
<WildCard Include="..\..\..\..\Assets\images\spritesheet\iPad\*.png">
@jonathanpeppers
jonathanpeppers / gist:8362757
Created January 10, 2014 21:16
Add this to your csproj file, before the end of the closing </Project> tag to get AndroidManifest.xml replacement.
<Target Name="BeforeBuild" Condition=" '$(JENKINS)' == '1' ">
<XmlPoke XmlInputPath="Properties\AndroidManifest.xml" Namespaces="&lt;Namespace Prefix='android' Uri='http://schemas.android.com/apk/res/android' /&gt;" Query="manifest/@android:versionCode" Value="$(SVN_REVISION)" />
<XmlPoke XmlInputPath="Properties\AndroidManifest.xml" Namespaces="&lt;Namespace Prefix='android' Uri='http://schemas.android.com/apk/res/android' /&gt;" Query="manifest/@android:versionName" Value="2.0.$(SVN_REVISION)" />
</Target>
@jonathanpeppers
jonathanpeppers / gist:8362816
Created January 10, 2014 21:19
Properties for building an Android package command line
/p:Configuration=Release;AndroidKeyStore=True;AndroidSigningKeyStore=OurKey.keystore;AndroidSigningStorePass=ourpassword;AndroidSigningKeyAlias=ouralias;AndroidSigningKeyPass=ourpassword /t:SignAndroidPackage
// An example class, in the real world would talk to a web
// server or database.
public class ProductRepository
{
//OTHER CODE HERE
public async Task<Product[]> SearchProducts(
string searchTerm)
{
// Wait 2 seconds to simulate web request
var message = await service.SendMessage(new Message
{
UserId = settings.User.Id,
ConversationId = Conversation.Id,
Text = Text,
});
using System;
using System.Linq;
using System.Collections.Generic;
using System.Threading.Tasks;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.StoreKit;
namespace InAppPurchases
{
//// General Declarations
var colorSpace = CGColorSpace.CreateDeviceRGB();
var context = UIGraphics.GetCurrentContext();
//// Color Declarations
UIColor color = UIColor.FromRGBA(1.000f, 1.000f, 1.000f, 1.000f);
UIColor color2 = UIColor.FromRGBA(0.110f, 0.110f, 0.110f, 1.000f);
UIColor color3 = UIColor.FromRGBA(0.118f, 0.118f, 0.118f, 1.000f);
//// Gradient Declarations
//// General Declarations
var colorSpace = CGColorSpace.CreateDeviceRGB();
var context = UIGraphics.GetCurrentContext();
//// Color Declarations
var color4 = UIColor.FromRGBA(0.761f, 0.678f, 0.310f, 0.000f);
var color5 = UIColor.FromRGBA(0.761f, 0.678f, 0.310f, 0.349f);
//// Gradient Declarations
var defaultGradientForegroundToTransparentForegroundToTransparentColors = new CGColor [] {color4.CGColor, color5.CGColor};
//// General Declarations
var colorSpace = CGColorSpace.CreateDeviceRGB();
var context = UIGraphics.GetCurrentContext();
//// Color Declarations
var color4 = UIColor.FromRGBA(0.761f, 0.678f, 0.310f, 0.000f);
var color5 = UIColor.FromRGBA(0.761f, 0.678f, 0.310f, 0.349f);
//// Gradient Declarations
var defaultGradientForegroundToTransparentForegroundToTransparentColors = new CGColor [] {color4.CGColor, color5.CGColor};