Skip to content

Instantly share code, notes, and snippets.

View nicwise's full-sized avatar
🙀
Screaming At Clouds

Nic Wise nicwise

🙀
Screaming At Clouds
View GitHub Profile
using System;
using MonoTouch.Dialog;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace MobileAgent
{
public class AddCarDialogViewController : BaseDetailDialogViewController
public bool UploadProjects(BaseSyncProgress syncProgress)
{
// then map the pending TS's, and insert
bool res = true;
try
{
List<PendingProject> projects = new List<PendingProject>();
Util.Log("Creating pending contacts");
int count = 1;
CLLocationManager locationManager = null;
public void GetForCurrentLocation (double distance, Action<List<Marker>, int> OnRegionUpdate)
{
if (CLLocationManager.LocationServicesEnabled)
{
if (locationManager == null)
{
@nicwise
nicwise / gist:1342861
Created November 6, 2011 13:15
json stuff
GIST #1:
Many:
/v2/tasks
{ "tasks":[
{
"path":"/v2/tasks/1",
"project":"/v2/projects/1",
@nicwise
nicwise / gist:1362490
Created November 13, 2011 18:57
glass button
Section loginSection = new Section();
var loginButton = new BTButtonElement("Settings", BTButtonElement.Green);
loginButton.Tapped += delegate {
AppLauncher.Instance.SetupLoginDialog(this.ParentViewController, true, delegate {
DataSource.Instance.RefreshRegisteredViewControllers();
});
};
loginSection.Add(loginButton);
[Ignore]
public UIImage ExpenseImage
{
get
{
string basePath = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments), "expenseimages");
if (!Directory.Exists(basePath)) Directory.CreateDirectory(basePath);
string filename = Path.Combine (basePath, string.Format("{0}.jpg", Id));
if (File.Exists(filename))
{
@nicwise
nicwise / gist:1388120
Created November 23, 2011 07:35
using ALAssetLibrary
public partial class AppDelegate : UIApplicationDelegate
{
// class-level declarations
UIWindow window;
OwenViewController viewController;
ALAssetsLibrary lib;
UIImage image;
NSDictionary dict = new NSDictionary ();
//
// This method is invoked when the application has loaded and is ready to run. In this
@nicwise
nicwise / gist:1388126
Created November 23, 2011 07:41
failing ALAssetLibrary
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.AssetsLibrary;
namespace Owen
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
@nicwise
nicwise / gist:1388137
Created November 23, 2011 07:50
tweetme!
var content = new StringBuilder();
content.AppendFormat("status={0}", OAuth.PercentEncode(tweetText));
var stringContent = content.ToString();
System.Net.ServicePointManager.Expect100Continue = false;
var client = new WebClient();
Uri uri = new Uri("http://twitter.com/statuses/update.json");
@nicwise
nicwise / gist:1398236
Created November 27, 2011 22:00
oauth outhorizer
//
// OAuth framework for TweetStation
//
// Author;
// Miguel de Icaza (miguel@gnome.org)
//
// Possible optimizations:
// Instead of sorting every time, keep things sorted
// Reuse the same dictionary, update the values
//