Skip to content

Instantly share code, notes, and snippets.

namespace FSHelloSceneKit
open System
open MonoTouch.UIKit
open MonoTouch.Foundation
open MonoTouch.SceneKit
type FSHelloSceneKitViewController () =
inherit UIViewController()
rollin in C.T. ...VW in gear 3
pickin up the milk, the produce, and some tea
dropin crazy rhymes, while I'm running out of time
got my wife some flowers, forgot the movie, but got Amazon Prime
hey ho
but got Amazon Prime
hey ho
but got Amazon Prime
@mikebluestein
mikebluestein / gist:985273c7db8b33698668
Created April 9, 2015 16:24
The Apple Review Song
I'm waiting and I'm waiting for my Apple review.
I'm going to get rejected and so are you.
I'm waiting and I'm waiting for my Apple review.
I have no watch. There's not much I can do.
I'm waiting and I'm waiting for my Apple review.
I may as well have built an app for a kazoo.
@mikebluestein
mikebluestein / Scene Kit Collada.md
Created June 12, 2015 18:30
simple example showing how to load a Collada file in Scene Kit using Xamarin.iOS
SCNScene scene;
SCNView sceneView;
SCNCamera camera;
SCNNode cameraNode;

public override void ViewDidLoad ()
{
	scene = SCNScene.FromFile ("duck", "ColladaModels.scnassets", new SCNSceneLoadingOptions ());
@mikebluestein
mikebluestein / gist:2079186
Created March 18, 2012 18:18
Add a TXTRecord using Bonjour and MonoTouch
NetDelegate _netDel;
NSNetService _ns;
void InitNetService ()
{
_ns = new NSNetService ("", "_testservice._tcp", UIDevice.CurrentDevice.Name, 9999);
_netDel = new NetDelegate ();
_ns.Delegate = _netDel;
// add TXTRecordData
public NSArray ToNSArray (int[] array)
{
NSArray nsArray = null;
var objects = Array.ConvertAll (array, i => (object)i);
if (objects != null) {
nsArray = NSArray.FromObjects (objects);
}
return nsArray;
//does the actual coloring
void DrawPoints (CGContext dctx)
{
dctx.BeginPath ();
dctx.MoveTo (Points.First().X, Points.First().Y);
dctx.SetLineWidth(swatchSlider.Value);
dctx.SetBlendMode (CGBlendMode.Normal);
foreach (var crayon in Crayons) {
public static class AutolayoutHelper
{
	[DllImport (Constants.ObjectiveCLibrary, EntryPoint = "objc_msgSend")]
	static extern IntPtr IntPtr_objc_msgSend (IntPtr receiver, IntPtr selector);

	public static void AutoLayoutTrace ()
	{
		var trace = Runtime.GetNSObject (IntPtr_objc_msgSend (UIApplication.SharedApplication.KeyWindow.Handle, new Selector ("_autolayoutTrace").Handle));
NSError err;
ab = ABAddressBook.Create (out err);
if (err == null) {
ab.RequestAccess ((allowed, err1) => {
if (allowed) {
var people = ab.GetPeople ();
foreach (ABPerson person in people) {
@mikebluestein
mikebluestein / gist:8061285
Created December 20, 2013 20:46
NSAttributedString with HTML
NSError error = null;
var htmlString = new NSAttributedString (NSUrl.FromFilename (
"Test.html"),
new NSAttributedStringDocumentAttributes{ DocumentType = NSDocumentType.HTML },
ref error);
textView.AttributedText = htmlString;