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
@nicwise
nicwise / scale.cs
Last active November 13, 2018 08:17
Scale and Rotate an image in iOS / MonoTouch, using the EXIF data
//MIT license
public static UIImage ScaleImage(UIImage image, int maxSize)
{
UIImage res;
using (CGImage imageRef = image.CGImage)
{
CGImageAlphaInfo alphaInfo = imageRef.AlphaInfo;
@nicwise
nicwise / output.txt
Created April 26, 2011 09:12
Monotouch 4.0.1 output - works without LLVM, this happens with LLVM + everything turned on
Building: mobileAgent (Release|iPhone)
Building Solution mobileAgent
Building: MonoTouch.Dialog (Release|iPhone)
Performing main compilation...
/Developer/MonoTouch/usr/bin/smcs /noconfig "/out:/Users/nic/code/git/monotouch.dialog/MonoTouch.Dialog/bin/iPhone/Release/MonoTouch.Dialog.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" /nologo /warn:4 /optimize- /codepage:utf8 /t:library "/Users/nic/code/git/monotouch.dialog/MonoTouch.Dialog/Elements.cs" "/Users/nic/code/git/monotouch.dialog/MonoTouch.Dialog/DialogViewController.cs" "/Users/nic/code/git/monotouch.dialog/MonoTouch.Dialog/Reflect.cs" "/Users/nic/code/git/monotouch.dialog/MonoTouch.Dialog/ElementBadge.cs" "/Users/nic/code/git/monotouch.dialog/MonoTouch.Dialog/Controls.cs" "/Users/nic/code/git/monotouch.dialog/MonoTouch.Dialog/ActivityElement.cs" "/Users/nic/code/git
@nicwise
nicwise / multiline.cs
Created May 3, 2011 07:29
Multiline Edit Element for MonoTouch.Dialog
using System;
using MonoTouch.Dialog;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
using System.Drawing;
using MonoTouch.CoreGraphics;
namespace DeadDrop
{
@nicwise
nicwise / test.cs
Created May 5, 2011 19:03
some sample MT setup code
// This method is invoked when the application has loaded its UI and its ready to run
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackOpaque;
tabBar = new UITabBarController();
MainView = tabBar.View;
window.AddSubview(MainView);
using umbraco.BusinessLogic;
using umbraco.cms.businesslogic;
using umbraco.cms.businesslogic.web;
using umbraco.cms.businesslogic.media;
using umbraco;
namespace UmbracoDefaultSorting
{
public class TestAppBase : umbraco.BusinessLogic.ApplicationBase
{
@nicwise
nicwise / gist:1122951
Created August 3, 2011 15:44
errors with MetroTweet
MT calls:
http://api.twitter.com/1/users/show.json?screen_name=ali_mcgill
it gets back
{"error":"Rate limit exceeded. Clients may not make more than 150 requests per hour.","request":"\/1\/users\/show.json?screen_name=ali_mcgill"}
(yay, I'm on a shared connection - one IP for ALL of universal music.)
@nicwise
nicwise / gist:1315899
Created October 26, 2011 09:37
MT.D code
using System;
using MonoTouch.Dialog;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
using System.Drawing;
using MonoTouch.CoreGraphics;
using System.Linq;
using System.Collections.Generic;
using System.Globalization;
@nicwise
nicwise / gist:1319168
Created October 27, 2011 09:35
Scroll view stuff
float pageControlHeight = 18.0f;
UIScrollView scrollView;
UIPageControl pageControl;
public void BuildAndReloadUI(List<Marker> markers, int favCount)
{
Util.TurnOffNetworkActivity();
CleanView();
Use:
var floatElement = new MVFloatElement(null, null, 0.5);
floatElement.OnValueChange += delegate(fe) {
//do something with fe.Value, or floatElement.Value
};
public class MVFloatElement : Element
{
public bool ShowCaption;
Section sect = new Section();
var stringElement = new Stringelement(etc etc);
var floatElement = new MVFloatElement(etc etc);
floatElement.OnValueChange += delegate(f) {
stringElement.Value = string.Format("I just got {0:0.00}", f);
//I think you need to do a reload of the tableview here, so it updates.
//