Skip to content

Instantly share code, notes, and snippets.

View afj176's full-sized avatar

Antonio Fernandes afj176

View GitHub Profile
///////////////////////////////////////////////////////////////////////////////////////////
// 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 );
@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.
});
@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 / 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


/**
* Setup Module with `highlight` filter
*/
var JekyllApp = angular.module('JekyllApp', [], function ($routeProvider, $locationProvider) {
$locationProvider.html5Mode(false);
});
JekyllApp.filter('highlight', function () {
return function (text, filter) {
@afj176
afj176 / example-from-jquery-vertical-timeline.js
Created March 11, 2014 16:45
example from jquery vertical timeline
/**
*
*
*
*/
(function($) {
"use strict";
var eventPrepData = [{
@afj176
afj176 / mock-playlist
Created May 30, 2014 06:36
Mock Playlist
"Biggie Smalls feat. Jay-Z" "I Love The Dough" "http://a.tumblr.com/tumblr_lekfx87hTD1qcgewao1.mp3"
"LL Cool J" "Mama-Said-Knock-You-Out" "http://www.clowndrowner.com/wp-content/uploads/2010/07/LL-Cool-J-Mama-Said-Knock-You-Out.mp3"
"OutKast" "ATLiens" "http://n1.vmuzike.net/music/OutKast/ATLiens.mp3"
"Run DMC" "Run's House" "http://chrismorris.ca/clients/frito/RunsHouse.mp3"
"Beastie Boys" "So Watcha Want" "http://fragxperts.com/tunes/4.Beastie%20Boys%20-%20So%20Watcha%20Want.mp3"

Deploy your own PaaS!

Setting up Dokku with DigitalOcean and Namecheap

..or how I made my own heroku in a few hours for $3.98.

This write-up owes a great deal to dscape's Node.js Deployments with Docker, Dokku, & Digital Ocean, the dokku project itself, and the fine folks working on dokku's issues. I took dscape's article as a starting point when trying this out but found some details lacking so I documented my own process for getting dokku up and running.

1. Get a domain

@afj176
afj176 / designer.html
Created October 23, 2014 04:45
designer
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
<template>
<style>

26 time management hacks I wish I'd known at 20

  1. There's always time. Time is priorities
  2. Days always fill up | "Only plan for 4-5 hours of real work per day."
  3. Work more when you're in the zone. Relax when you're not. | "It's normal to have days where you just can't work and days where you'll work 12 hours straight"
  4. Respect your time and make it respected | "Your time is $1000/hour, and you need to act accordingly"
  5. Stop multi-tasking. It merely kills your focus.
  6. Set up a work routine and stick to it. Your body will adapt
  7. We're always more focused and productive with limited time.
  8. Work is the best way to get working. Start with short tasks to get the ball rolling.