Thursday, June 18, 2015

App Prototyping: Getting Started with Facebook Origami

In the world of software development a prototype is a working, rudimentary version of an app (or site), and is usually built for the purposes of testing and gathering feedback.

A well-executed prototype will always provide a more reliable idea of how your finished app will work than even a dozen static mockup pages can.

But not all designers and teams are equipped to build such prototypes. Coding something from scratch takes time and specialist skills, while many online tools require some sort of subscription.

Happily, just over a year ago Facebook released Origami - a free tool for designing modern UIs and interactive prototypes without the need to write a single line of code.

It's certainly been battle tested – Facebook has used Origami to build several of its flagship apps such as Instagram, Messenger, Slingshot and Facebook Paper.

Introduction

Facebook Origami in itself is just a big stack of Quartz Composer 'patches' that make it easy to develop working mockups that include demonstrate animations and other complex interactions. Patches are pre-existing modules of animations, graphics or interactions. You can think of patches as the bricks you use to build your prototype.

The best way to understand Quartz Composer is to think of it as a visual programming tool that can take input parameters and output results. It allows you to import your Sketch or Photoshop layers in the form of patches, and then wire them together with animations and events, till you've crafted an experience that mimics what your finished app will be like.

Once you get a hang of Quartz Composer, you should be able to almost effortlessly pull together prototypes in no time. There's a more detailed rundown on the history Quartz Composer here. To download Origami, follow these steps at their official website under the download section found here.

Introduction to Facebook Origami

Origami: An Overview

Code Export

When the prototype is approved, it is time for the engineers to make it happen. Obviously this can be a very challenging process for both designer and programmer, who need to work together closely to ensure the end product closely matches the prototype.

Issues can arise when this end product isn't a close enough replica of the approved prototype.

But thanks to Origami's Code Export, engineers can easily tackle this hassle by exporting the code needed to have the identical animations in iOS, Android and the Web.

Code Export

Sketch Integration

Sketch Integration

Origami's Sketch integration allows you to directly link your layers designed in Sketch App with your prototype. This means every time you edit your design in Sketch, the updates will be automatically reflected in your Origami project.

Presentation Mode

With presentation mode you can beautifully present your prototypes in front of audiences in fullscreen mode featuring different background images, a human hand holding a device and touch pointers.

You can control the prototype directly from an iPhone or iPad if you have any, or through the trackpad of your Apple device.

You can find a more detailed information on the individual features in the official Origami website, by following this link.

The Interface and Basic Tools

When you boot Quartz Composer you are first greeted with the "Template Chooser" window. To start a new Origami project, go to: "File > New Origami File" or ⌥⌘N.

After creating your Origami project you will be prompted with three overlapping windows. To give your workplace a better and cleaner look go to: "Window > Resize to Thirds" or ⌃⌥⌘0.

Creating a new Origami File

Resizing the windows to thirds

1. The Editor Window

The Editor window is your main working space – a work table where you drag and drop your patches and assemble the best combination of animations and interactions by wiring together different layers of your design.

From the Editor Window you also have access to other tools and windows, like the Patch Library, Viewer Window, Patch Inspector and basic tools buttons such as Back/Forward and Zoom in/out. The Editor Window

Continue reading %App Prototyping: Getting Started with Facebook Origami%


by Mateo Prifti via SitePoint

Creating Tests for Your Sass Framework

So you've written (or want to write) an awesome Sass toolkit, framework, or even a small function or mixin, and you want to share it with the world. Fantastic! That's what's great about open-source software development -- you get to collaborate on code with other supportive developers in the community to create useful software that many can benefit from.

But, not so fast! It's very important to test your software before releasing it. One of the most efficient ways to do this is with unit tests, which are automated scripts that test if a single function of a single unit of code behaves according to a defined specification.

Sass gives you the ability to manipulate data using functions, operators, variables, and control directives and expressions. The return value of a @function can also be tested directly against the expected value. For CSS output and visual regression testing, a tool like PhantomCSS is better suited for the job, though @mixins can be tested in the latest version of True.

We will be using Eric Suzanne's True testing framework for unit testing sample functions in Sass, but the guidelines presented are applicable for any Sass testing framework. For simple tests, you might want to use a minimalistic (and awesome) Sass testing framework such as Hugo Giraudel's SassyTester.

Continue reading %Creating Tests for Your Sass Framework%


by David Khourshid via SitePoint

Nokogiri Fundamentals: Extract HTML from the Web

Vector code maintenance icon

Most people get very confused when they try to learn Nokogiri without mastering some fundamentals first. There is a reason for this. Trying to learn Nokogiri without learning the things that make it work is like trying to learn the features of Word without knowing how to type. By the end of this article, you'll be comfortable with taking a web site and extracting any piece of data from it.

Nokogiri is one of the most popular Ruby gems, with over 37 million downloads at publication time . Just as a comparison, Rails has 47 million downloads currently. My first thought after seeing this was: "Wow, if this gem is so popular, there must be some pretty comprehensive tutorials for it, right?" If you type "rails tutorial" into Google, you'll get over 280,000 results. A search for "nokogiri tutorial" gives you...less than 3000 results (on the bright side, this number should get bigger after this article is released!).

Continue reading %Nokogiri Fundamentals: Extract HTML from the Web%


by Darko Gjorgjievski via SitePoint

Creating a Web App From Scratch Using Python Flask and MySQL: Part 2

The Tuts+ Guide to Template Tags: Second Batch

In the second part of the series, we went through the first batch of WordPress template tags. In this third part, we're going to go through the second batch of the almost 200 template tags. Throughout the tutorial, we'll see template tags about taxonomies and terms.

Getting the Description of a Category: category_description()

This template tag returns the description of a category.

Parameters

This template tag accepts only one parameter:

  • $category_ID (optional—integer):
    The ID of the category.
    (Default: The queried category)

Usage

Getting the Description of a Tag: tag_description()

This template tag returns the description of a tag.

Parameters

This template tag accepts only one parameter:

  • $tag_ID (optional—integer):
    The ID of the tag.
    (Default: Current tag)

Usage

Getting the Description of a Term: term_description()

This template tag simply returns the description of a term.

Parameters

This template tag accepts two parameters:

  • $term_ID (optional—integer):
    The ID of the term.
    (Default: Current term)
  • $taxonomy (optional—string):
    The taxonomy of the term.
    (Default: 'post_tag')

Usage

Getting & Displaying a Page Title for Category Archives: single_cat_title()

This template tag returns and displays the category's title for using in page titles.

Parameters

This template tag accepts two parameters:

  • $prefix (optional—string):
    Prefix to the title.
    (Default: Empty)
  • $echo (optional—boolean):
    Whether echo (TRUE) or return (FALSE) the tag.
    (Default: TRUE)

Usage

Getting & Displaying a Page Title for Tag Archives: single_tag_title()

This template tag returns and displays the tag's title for using in page titles.

Parameters

This template tag accepts two parameters:

  • $prefix (optional—string):
    Prefix to the title.
    (Default: Empty)
  • $echo (optional—boolean):
    Whether echo (TRUE) or return (FALSE) the tag.
    (Default: TRUE)

Usage

Getting & Displaying a Page Title for Term Archives: single_term_title()

This template tag returns and displays the term's title for using in page titles.

Parameters

This template tag accepts two parameters:

  • $prefix (optional—string):
    Prefix to the title.
    (Default: Empty)
  • $echo (optional—boolean):
    Whether echo (TRUE) or return (FALSE) the tag.
    (Default: TRUE)

Usage

Getting & Displaying the Categories of the Post: get_the_category_list() & the_category()

These template tags fetch and output the categories that are assigned to the post.

Parameters

Both template tags accept three parameters:

  • $separator (optional—string):
    Separator text.
    (Default: Empty—if this parameter is empty, the functions will return and display an unordered list of categories)
  • $parents (optional—string):
    How to display parent categories ('multiple', 'single' or empty).
    (Default: Empty)
  • $post_ID (optional—integer):
    The ID of the post.
    (Default: Current post)

Usage

Getting & Displaying the Categories of the Post for Feeds: get_the_category_rss() & the_category_rss()

These template tags make the categories that are assigned to the post ready for feeds and return or display it.

Parameters

Both template tags accept only one parameter:

  • $feed_type (optional—string):
    Type of the feed.
    (Default: Default feed type)

Usage

Getting & Displaying the Tags of a Post: get_the_tag_list() & the_tags()

These template tags return or display the tags of your posts.

Parameters

Both template tags accept three parameters:

  • $before (optional—string):
    The text or HTML code to display before the output.
    (Default: Empty for get_the_tag_list() and 'Tags: ' for the_tags())
  • $sep (optional—string):
    The text to be used as a separator.
    (Default: Empty for get_the_tag_list() and ', ' for the_tags())
  • $after (optional—string):
    The text or HTML code to display after the output.
    (Default: Empty)

Usage

Getting & Displaying the Terms of a Post: get_the_term_list() & the_terms()

These template tags get and echo a list of terms assigned for the post.

Parameters

Both template tags accept five parameters:

  • $post_ID (optional—integer):
    The ID of the post.
    (Default: Current post)
  • $taxonomy (required—string):
    Taxonomy to display its terms.
    (Default: Empty)
  • $before (optional—string):
    The text or HTML code to display before the output.
    (Default: Empty)
  • $sep (optional—string):
    Separator text.
    (Default: ', ')
  • $after (optional—string):
    The text or HTML code to display after the output.
    (Default: Empty)

Usage

Displaying the Taxonomies of a Post: the_taxonomies()

This template tag displays the taxonomies and the terms associated with those taxonomies.

Parameters

This template tag accepts only one parameter:

  • $args (optional—array):
    An array of the following arguments:
    • 'post' (integer): Post ID.
      (Default: 0)
    • 'before' (string): HTML code to add before the output.
      (Default: Empty)
    • 'sep' (string): Separator text.
      (Default: ' ')
    • 'after' (string): HTML code to add after the output.
      (Default: Empty)
    • 'template' (string): The template to use for displaying the taxonomy terms.
      (Default: '%s: %l.' where %s is the taxonomy label and %t is the list of term links)

Usage

Getting & Displaying the "Edit Tag" Link: get_edit_tag_link() & edit_tag_link()

These template tags return or echo a "edit this tag" link for you to use in your templates.

Parameters

get_edit_tag_link() accepts two parameters:

  • $tag_ID (required—integer):
    The ID of the tag.
    (Default: NULL)
  • $taxonomy (optional—string):
    The type of taxonomy.
    (Default: 'post_tag')

And edit_tag_link() accepts four parameters:

  • $link (optional—string):
    Text to display for the link.
    (Default: 'Edit This')
  • $before (optional—string):
    The text or HTML code to display before the output.
    (Default: Empty)
  • $after (optional—string):
    The text or HTML code to display after the output.
    (Default: Empty)
  • $tag (required—object):
    Tag object.
    (Default: NULL)

Usage

Getting & Displaying the List of Categories: wp_list_categories()

This template tag returns or displays a list of categories or terms from any kind of taxonomy.

Parameters

This template tag accepts only one parameter:

  • $args (optional—array):
    An array of the following arguments:
    • 'show_option_all' (string): Shows a link to home (or the "Posts" page set in Settings > Reading) if you set it to a non-blank value. The value will be the anchor text of the link.
      (Default: Empty)
    • 'show_option_none' (string): Text to show if there aren't any categories.
      (Default: 'No categories')
    • 'orderby' (string): How to order the links by. Accepts 'name', 'ID', 'slug', 'count' and 'term_group'.
      (Default: 'name')
    • 'order' (string): Whether to order items in ascending ('ASC') or descending ('DESC') order.
      (Default: 'ASC')
    • 'style' (string): Style to display categories—'list' to generate an unordered list or 'none' to generate a list of links separated with <br />s.
      (Default: 'list')
    • 'show_count' (integer): Show post count next to each category link.
      (Default: 0)
    • 'hide_empty' (integer): Hide empty categories or not.
      (Default: 1)
    • 'use_desc_for_title' (integer): Use descriptions as "title" attributes of the links.
      (Default: 1)
    • 'child_of' (integer): Displays only children of a given ID of a category.
      (Default: 0)
    • 'feed' (string): If set to any non-blank value, category feed links will appear next to category links. The value will be the anchor text of the links.
      (Default: Empty)
    • 'feed_type' (string): Type of feed ('rss', 'rss2', 'atom' or 'rdf').
      (Default: Empty)
    • 'feed_image' (string): Image path to override anchor text and show an image instead.
      (Default: Empty)
    • 'exclude' (string): Comma-separated list of category IDs to exclude.
      (Default: Empty)
    • 'exclude_tree' (string): Same as "exclude", but you must use this one if the "hierarchical" argument is set to 1
      (Default: Empty)
    • 'current_category' (integer): Adds a "current-cat" class when suitable.
      (Default: 0)
    • 'hierarchical' (integer): Display items with a hierarchical order or not.
      (Default: 1)
    • 'title_li' (string): Wraps the output with a <li> tag and displays a title before the category list. You would probably want to set this to an empty string and disable wrapping.
      (Default: 'Categories')
    • 'echo' (integer): Whether to echo the output (1) or return it (0).
      (Default: 1)
    • 'depth' (integer): Maximum depth.
      (Default: 0)
    • 'taxonomy' (string): Taxonomy to list.
      (Default: 'category')

Usage

Getting & Displaying an HTML Dropdown of Categories: wp_dropdown_categories()

This template tag returns or echoes a dropdown menu (<select>) of categories or terms from a taxonomy of your choice.

Parameters

This template tag accepts only one parameter:

  • $args (optional—array):
    An array of the following arguments:
    • 'show_option_all' (string): Text to display for showing all categories/taxonomies.
      (Default: Empty)
    • 'show_option_none' (string): Text to display for showing no categories/taxonomies.
      (Default: Empty)
    • 'option_none_value' (mixed): Value to use when no category/taxonomy is selected.
      (Default: -1)
    • 'orderby' (string): What column to use for ordering the categories/taxonomies.
      (Default: 'ID')
    • 'order' (string): What direction to order categories/taxonomies.
      (Default: 'ASC')
    • 'show_count' (boolean or integer): Whether to show how many posts are in the category/taxonomy.
      (Default: 0)
    • 'hide_empty' (boolean or integer): Whether to hide categories/taxonomies that don't have any posts attached to them.
      (Default: 1)
    • 'child_of' (integer): Display all categories that are descendants of the given ID.
      (Default: 0)
    • 'exclude' (string): Comma-separated list of category/taxonomy IDs to exclude from the list.
      (Default: Empty)
    • 'echo' (boolean or integer): Whether to display or retrieve content.
      (Default: 1)
    • 'depth' (integer): The max depth.
      (Default: 0)
    • 'tab_index' (integer): Tab index for the SELECT element.
      (Default: 0)
    • 'name' (string): The NAME attribute value for the SELECT element.
      (Default: 'cat')
    • 'id' (string): The ID for the SELECT element.
      (Default: Empty)
    • 'class' (string): CSS class for the SELECT element.
      (Default: 'postform')
    • 'selected' (integer): The category/taxonomy ID to be selected by default.
      (Default: 0)
    • 'taxonomy' (string): The name of the taxonomy to retrieve.
      (Default: 'category')

Usage

Getting & Displaying the Tag Cloud: wp_tag_cloud()

This template tag returns or displays a cloud of terms, generated from a taxonomy of your choice (tags by default).

Parameters

This template tag accepts only one parameter:

  • $args (optional—array):
    An array of the following arguments:
    • 'smallest' (integer): Smallest text size.
      (Default: 8)
    • 'largest' (integer): Largest text size.
      (Default: 22)
    • 'unit' (string): Text size unit.
      (Default: 'pt')
    • 'number' (string): How many tags to return
      (Default: 45)
    • 'format' (string): How to return the tags list—'flat' for a flat list separated with spaces, 'list' for an HTML unordered list, and 'array' for a PHP array.
      (Default: 'flat')
    • 'separator' (string): Separator text.
      (Default: "\n")
    • 'orderby' (string): How to order the tags by ('name' or 'count').
      (Default: 'name')
    • 'order' (string): Whether to order items in ascending ('ASC') or descending ('DESC') order.
      (Default: 'ASC')
    • 'include' (array): An array of IDs to include.
      (Default: Empty)
    • 'exclude' (array): An array of IDs to exclude.
      (Default: Empty)
    • 'taxonomy' (string): Taxonomy to get the terms from.
      (Default: 'post_tag')
    • 'link' (string): 'view' for front-end viewing, 'edit' for back-end editing links. Works with the 'post_type' argument.
      (Default: 'view')
    • 'post_type' (string): If the 'link' argument is set to 'edit', you must set 'post_type' to a post type to set which type of posts will the "edit links" list.
      (Default: Empty)
    • 'echo' (boolean): Whether to echo the template tag or not.
      (Default: TRUE)

Usage

Getting a Custom Generated Tag Cloud: wp_generate_tag_cloud()

This template tag returns a tag cloud but this time, you get to choose your own tags.

Parameters

This template tag accepts two parameters:

  • $tags (required—array):
    An array of a list of tags.
    (Default: NULL)
  • $args (optional—array):
    An array of the following arguments:
    • 'smallest' (integer): Smallest text size.
      (Default: 8)
    • 'largest' (integer): Largest text size.
      (Default: 22)
    • 'unit' (string): Text size unit.
      (Default: 'pt')
    • 'number' (string): How many tags to return
      (Default: 0)
    • 'format' (string): How to return the tags list—'flat' for a flat list separated with spaces, 'list' for an HTML unordered list, and 'array' for a PHP array.
      (Default: 'flat')
    • 'separator' (string): Separator text.
      (Default: "\n")
    • 'orderby' (string): How to order the tags by ('name' or 'count').
      (Default: 'name')
    • 'order' (string): Whether to order items in ascending ('ASC') or descending ('DESC') order.
      (Default: 'ASC')
    • 'topic_count_text' (string): This is a nooped plural from _n_noop() to generate the text for the tooltip of the tag link.
      (Default: NULL)
    • 'topic_count_text_callback' (string): This is the callback function, which gives the count of the posts with that tag returns a text for the tooltip of the tag link.
      (Default: NULL)
    • 'topic_count_scale_callback' (string): This is the callback function that works with the 'smallest' and 'largest' arguments to calculate the font sizes of generated tags.
      (Default: 'default_topic_count_scale')
    • 'filter' (integer): If this is set to 0, the function won't pass the filter with the same name.
      (Default: 1)

Usage

Conclusion

Hope you liked this second batch of template tags. There are six more batches to go, so stay tuned for more template tags!

If you have any questions, comments or corrections, you can share your thoughts with us in the Comments section. And if you liked the article, don't forget to share it with your friends!


by Barış Ünver via Tuts+ Code

Arthur

Arthur

Real clean to-the-point One Pager for 'Arthur' - an OS X app to manage those hidden Mac settings.

by Rob Hope via One Page Love

Habib Fadel

Official website of the Lebanese Artist Habib Fadel
by via Awwwards - Sites of the day