Skip to content

Instantly share code, notes, and snippets.

View afj176's full-sized avatar

Antonio Fernandes afj176

View GitHub Profile
@afj176
afj176 / n7-2013-media-queries.md
Last active January 5, 2016 11:09
Working out how to target nexus 7(2013) over nexus 7(2012)

Targeting Nexus 7 2012 & 2013

Media Query Differences

Demo here


@afj176
afj176 / api.js
Created January 3, 2013 17:25 — forked from fwielstra/api.js
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');
@afj176
afj176 / promises.md
Created December 11, 2012 13:55 — forked from domenic/promises.md
You're Missing the Point of Promises

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
    // the rest of your code goes here.
});
///////////////////////////////////////////////////////////////////////////////////////////
// CODE TO ADD POST PER PAGE FILTER
///////////////////////////////////////////////////////////////////////////////////////////
add_filter( 'edit_posts_per_page', 'reorder_edit_posts_per_page', 10, 2 );
function reorder_edit_posts_per_page( $per_page, $post_type ) {
// CHECK USER PERMISSIONS
if ( !current_user_can('edit_others_pages') )
return;
$post_type_object = get_post_type_object( $post_type );