Skip to content

Instantly share code, notes, and snippets.

View escoz's full-sized avatar

Eduardo Scoz escoz

  • Google
  • San Francisco, CA
View GitHub Profile
@escoz
escoz / gist:2640625
Created May 9, 2012 00:12
quickdialog+couchdb
// loads json files directly from couchdb, and syncs to data also in couch.
#import "QRootElement+CouchDocument.h"
#import "App.h"
#import <CouchCocoa/CouchCocoa.h>
@implementation QRootElement (CouchDocument)
@escoz
escoz / gist:1216828
Created September 14, 2011 15:09
Damn button.
- (void)viewDidLoad {
[super viewDidLoad];
UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(onSave)];
item.enabled = NO;
NSLog(@"%@", item); // OBJ is NOT nil here.
self.navigationItem.rightBarButtonItem = item;
}
@escoz
escoz / gist:1013179
Created June 7, 2011 21:12
ActionSheetView with delegate
using System;
using System.Drawing;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace Sample
{
public class ActionSheetView : UIActionSheet
{
@escoz
escoz / C# unless
Created December 10, 2010 22:02
teste
// stupid unless keyword for C#
// lets say I want to print items if they're are not editable:
// you can do:
foreach (var i in items) {
if (!i.editable) print(i);
}
// or
@escoz
escoz / EscozUrlConnection.cs
Created November 24, 2010 22:40
NSUrlConnection wrapper class to simplify networking using it with MonoTouch.
using System;
using MonoTouch.Foundation;
using System.Collections.Generic;
using MonoTouch.UIKit;
namespace ESCOZ
{
public class EscozUrlConnection:NSUrlConnection {
private static Dictionary<string, EscozUrlConnection> Connections = new Dictionary<string, EscozUrlConnection>();
private void _showCloseableModal(UIViewController controller) {
var nav = new UINavigationController(controller);
nav.NavigationBar.TintColor = UIColor.Black;
controller.NavigationItem.RightBarButtonItem = new UIBarButtonItem("Close", UIBarButtonItemStyle.Done, (object sender, EventArgs args)=>{
this.DismissModalViewControllerAnimated(true);
});
this.PresentModalViewController(nav , true);
}
Building: ClubTix (Debug|iPhone)
Building Solution ClubTix
Building: ClubTix (Debug|iPhone)
Detecting signing identity...
Provisioning profile: "Team Provisioning Profile: *" (16381EFB-2C1D-4F12-994F-42770FF2E221)
Signing Identity: "iPhone Developer: Eduardo Scoz (K8WCCTQ997)"
App ID: "NPV7Z3H224.1.0"
////// Linea.cs
using System;
using System.Drawing;
using MonoTouch.Foundation;
using MonoTouch.ObjCRuntime;
using MonoTouch.UIKit;
using MonoTouch.ExternalAccessory;
namespace LineaSDK
/// LineaSDK.cs
using System;
using System.Drawing;
using MonoTouch.Foundation;
using MonoTouch.ObjCRuntime;
using MonoTouch.UIKit;
namespace LineaSDK
{