Jamie Wilson

  • Archive
  • RSS
Really struggling with icon design today! It seems to be the last thing on my list when building an app, and gets the one hour treatment while i try and officially sign it off.
It does look a little like a biscuit..
Pop-upView Separately

Really struggling with icon design today! It seems to be the last thing on my list when building an app, and gets the one hour treatment while i try and officially sign it off.

It does look a little like a biscuit..

  • 1 year ago
  • Permalink
  • Share
    Tweet

Email Engine

Thought i’d shared some code I’ve been working on for the last wee while.

I’ve been chipping away at an email engine that will pair JSON data with an email template (my way of avoiding using XSLT). This is the part that pairs the data with the template.

The next thing I’d like to implement is some kind of loop (ie draw a div for each contact). But i’m still trying to work out the best syntax for that. (Even though this will be mainly handled in backend code, I’d like to expose it to users to allow them to edit their own templates - so the loop code needs to be simple)

Note to self: Suss better code display in Tumblr.



            string htmlEmailTemplate = "
{Contact[0].PhoneNumber}
"; string jsonArgs = "{Contact: [{ContactName: 'John', PhoneNumber: '0282399304'}, {ContactName: 'Sue', PhoneNumber: '0273652454'}]}"; var obj = JsonConvert.DeserializeObject>(jsonArgs, new JsonConverter[] { new MyConverter() }); var result = Regex.Replace(htmlEmailTemplate, @"{?{([^}^:]+)}?}", (m) => { // Skip escape values (ex: {{escaped value}} ) if (m.Value.StartsWith("{{")) return m.Value; var pieces = m.Groups[1].Value.Split('.'); dynamic value = obj; foreach (var piece in pieces) { if (piece.Contains('[')) { string objectName = ""; int objectCount = 0; var insert = Regex.Replace(piece, @"(.*?)\[(.*?)\]", (x) => { objectName = x.Groups[1].Value; objectCount = Int32.Parse(x.Groups[2].Value); return null; }); try { value = value[objectName][objectCount]; } catch (Exception ex) { Console.WriteLine(string.Format("Error for array value: {0}, Exception Message: {1}", piece, ex.Message)); return ""; } } else { try { value = value[piece]; } catch (Exception ex) { Console.WriteLine(string.Format("Error for value: {0}, Exception Message: {1}", piece, ex.Message)); return ""; } } } return value; }); Console.WriteLine(result);
  • 1 year ago
  • Permalink
  • Share
    Tweet

Objective-C Snippets

Set the status bar style first up:

[application setStatusBarStyle:UIStatusBarStyleBlackOpaque];

Dictionary with contents of an xml file:

NSError *error = nil;
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Structure" ofType:@"xml"];  
NSData *xmlData = [NSData dataWithContentsOfFile:filePath];
xmlDictionary = [[XMLReader dictionaryForXMLData:xmlData error:&error] retain];

Get the app delegate:

YourAppDelegate *appDelegate = (YourAppDelegate *)[[UIApplication sharedApplication] delegate];

Change button font and center image above text:

[ActionButton1.titleLabel setFont:[UIFont fontWithName: @"YourFont" size: 11]];
[ActionButton1 setTitleEdgeInsets:UIEdgeInsetsMake(16.0, -ActionButton1.imageView.image.size.width, -25.0, 0.0)];
[ActionButton1 setImageEdgeInsets:UIEdgeInsetsMake(-16.0, 0.0, 0.0, -ActionButton1.titleLabel.bounds.size.width)];

Push View to the Navigation Controller:

YourViewController *standardListView = [[YourViewController alloc] init];
[navigation pushViewController:standardListViewa animated:YES];  
[standardListView release];

And remove from it:

[self.navigationController popViewControllerAnimated:YES];

Make the background of the UINavigationBar an image:

UIImage *gradientImage32 = [[UIImage imageNamed:@"TopBanner"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
// Set the background image for *all* UINavigationBars
[[UINavigationBar appearance] setBackgroundImage:gradientImage32 forBarMetrics:UIBarMetricsDefault];

Use the reader to retrieve a NSArray:

+ (NSInteger)getItemCount:(NSDictionary *)dict {

    NSArray *yellowDictionary = [dict retrieveForPath:@"items.item"];
    
    return [yellowDictionary count];
    
}

Make a custom view adhere to both UITableViewDelegate and UITableViewDataSource

@interface StandardListView : UIViewController  {
}
  • 1 year ago
  • 1
  • Permalink
  • Share
    Tweet

Exploring Dart - Part 1

Update: Here is a really good discussion on how Dart is being developed within Google, and seems to point to a bit of longevity.

When I first heard about Google’s attempt to create a new client side language to replace Javascript I couldn’t see the point, and assumed the project would be dead in the water within months.

Javascript has many failures (NaN is a number?), but after spending some time looking into how to architect code in a way unique to javascript I’ve been pretty dismissive of those who struggle with the language.  hive.to is an example of an app that is driven by the client, and fully built in Javascript.

But Dart isn’t trying to replace form validation and jQuery UI.

You only have to take a look around the Chrome Webstore to see that installed apps are progressing onto the web quickly - there’s even a CAD app there.

In the Dart teams’ own words, the goals of the project are to provide a “structured yet flexible language for web programming”, make the language “feel familiar and natural to developers and thus easy to learn” and to “ensure that Dart delivers high performance on all modern web browsers.”

Downloading the environment was pretty painless: go here, open the IDE and you’ve started.

The second design goal of Dart is to feel familiar and thus easy to learn.  They’re bang on with this. If you’ve ever programmed with a C language or Java you’ll understand the structure straight away.  Though it does take a mindshift to start using what is essentially Javascript on steroids in this way.

When working with Javascript there is no framing needed to get a function firing, so starting an app by adding script inline and then cleaning up your code later is an easy way to get yourself into your project.

That isn’t necessarily the same in dart.  Here are two examples of the same thing:

No, dart doesn’t have the advantage of using jQuery to call selectors. But you can see from the basic structure of the dart example (this it the basic code you’ll be given when you create your first project in the IDE) that from the outset you have a proper application framework.

On the one hand, I’m already pretty excited about the possibilities of the what the browser could do with Dart. On the other, I’m unsure how committed to Dart Google actually is (the number of Google projects that fall off the radar is unsettling). But hopefully we’ll see a dart VM built into chromium in the near future.

My next step is to try and create some kind of basic app in Dart and see how I warm to the process. Now, if only they would get some decent documentation out there.

  • 1 year ago
  • Permalink
  • Share
    Tweet
Here is the final Thickshake Logo as it’s being seen in the invoices going out this month.  So exciting! Now onto the rest of the brand…
Pop-upView Separately

Here is the final Thickshake Logo as it’s being seen in the invoices going out this month.  So exciting! Now onto the rest of the brand…

  • 1 year ago
  • Permalink
  • Share
    Tweet
This… Has been killing me.
Pop-upView Separately

This… Has been killing me.

  • 1 year ago
  • Permalink
  • Share
    Tweet
Moxy Reports is one of our young products, and for the last few weeks i’ve been plugging away at the marketing site. 
We still have a way to go optimizing content and getting more graphics into some of the pages, but today, we went live!
I’ll write more about the process once we have the last stages complete, but for now, have a look at http://www.moxyreports.com/
Pop-upView Separately

Moxy Reports is one of our young products, and for the last few weeks i’ve been plugging away at the marketing site. 

We still have a way to go optimizing content and getting more graphics into some of the pages, but today, we went live!

I’ll write more about the process once we have the last stages complete, but for now, have a look at http://www.moxyreports.com/

  • 1 year ago
  • Permalink
  • Share
    Tweet
Thickshake has a logo! Tessa Gourley did the design and Amy Gough helped with the screen printing.
Pretty stoked!
Pop-upView Separately

Thickshake has a logo! Tessa Gourley did the design and Amy Gough helped with the screen printing.

Pretty stoked!

  • 1 year ago
  • Permalink
  • Share
    Tweet

Using Pages in Wordpress to power Widgets

Using the ID of a page, you can get the content, the featured image and the title to power widgets in your template.  

The $link is a no extra character version of the title so you can use it in classes etc.

  • 1 year ago
  • Permalink
  • Share
    Tweet

Supplanting Data with Equations

I wanted a nice way of using a simple block of HTML and substituting in the values from a data object.  I started with Douglas Crockford’s example from his beginner JS talk, and added the equation support. It’s limited, and I feel dirty for using ‘eval’, but it’s doing the trick well so far.

Have a play here: http://jsfiddle.net/_jamiewilson/PYNfK/

  • 1 year ago
  • Permalink
  • Share
    Tweet
← Newer • Older →
Page 2 of 3

About

Front end developer for EndGame, Hive and various other projects. Chat me up on Google Talk or by email with: jamie.wilsons@gmail.com

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr