Skip to content

Instantly share code, notes, and snippets.

View jarednova's full-sized avatar
🗽

Jared Novack jarednova

🗽
View GitHub Profile

What's one piece of advice you would give to an engineer/designer coming into an iOS project?

Read all the way through the iOS Human Interface guidelines, and familiarize yourself with the Apple developer documentation and sample code. UIKit provides more components than you'll know what to do with, but as soon as you receive a mockup that introduces any variations (no matter how subtle) you've got struggles ahead. Many of the core components (e.g. View Controllers, Table View Controllers, etc.) have dedicated guides and sample applications on the Apple developer site; start there. Stack Overflow rarely uncovered good solutions -- I came across more unresolved questions with a slew of hacky approaches in two months of iOS dev than I ever have with web dev. Learning how to grok the Apple API docs / support materials is essential, especially given that you can't read the source. What's one small change we could make to our process to improve the design/build process for iOS apps?

Building UIs in Interface Bui

<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Hello Jared!</Say>
<Say voice="woman" language="en-gb">Can't get enough of that wonderuful stuff.</Say>
</Response>
@jarednova
jarednova / Aldenta_Post.php
Last active August 7, 2016 16:09
Aldenta Images
<?php
class Aldenta_Post extends TimberPost {
function child_images() {
$thumb_id = get_post_thumbnail_id($this->ID);
return get_children(array('post_parent'=>$this->ID, 'post_status' => 'inherit', 'post_type' => 'attachment',
'post_mime_type' => 'image', 'order'=> 'ASC', 'orderby' => 'menu_order ID', 'exclude'=>$thumb_id));
}
}
<?php
class TimberAdmin {
public static function init() {
$action = add_action('in_plugin_update_message-timber-library/timber.php', array(__CLASS__, 'in_plugin_update_message'), 10, 2);
return add_filter( 'plugin_row_meta', array( __CLASS__, 'meta_links' ), 10, 2 );
}
{
"name": "upstatement/cooltheme",
"description": "Starter theme to build a Timber theme",
"type":"wordpress-theme",
"minimum-stability" : "dev",
"authors": [
{
"name": "andyrader",
"email": "andy.rader@upstatement.com"
<?php
function MyChildPostClass extends TimberPost {
function special_children() {
/* modify the query on line 7 as you need */
$children = get_children('post_parent=' . $this->ID . '&post_type=post&numberposts=-1&orderby=menu_order title&order=ASC&post_status=publish');
foreach ( $children as &$child ) {
$child = new $childPostClass($child->ID);
}
@jarednova
jarednova / functions.php
Last active November 24, 2018 21:00
example of easy shortcodes you can add in functions.php
<?php
add_shortcode( 'section-break', function($attributes = array(), $content = null) {
return '<div class="article-body-section-break"></div>';
} );
add_shortcode( 'email-tease', function($attributes = array(), $content = null) {
return Timber::compile('partials/newsletter.twig', array('context_class' => 'newsletter-signup--in-article', 'text' => $content));
} );
{{ post.get_field('my_field") }}
* {
box-sizing: border-box;
}
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,
$post = new TimberPost();
$context['post'] = $post;
$category = $post->category(); // this will be a TimberTerm assuming there's 1 or more category assigned to this post
$query = array('posts_per_page' => 6, 'cat' => $category->ID, 'post__not_in' => array($post->ID));
$context['latest'] = Timber::get_posts($query);
//the rest as you had it in your gist