Skip to content

Instantly share code, notes, and snippets.

View iammilton82's full-sized avatar

Milton Jackson iammilton82

View GitHub Profile
//set up pods::find parameters to limit to 5 items
$param = array(
'limit' => 5,
//create pods object
$pods = pods('pod_name', $params );
//check that total values (given limit) returned is greater than zero
if ( $pods->total() > 0 ) {
iammilton82 / self-publishing.txt
Created September 24, 2017 19:14
Tips to Self Publishing
The most important things to start with:
A title and a one to two paragraph description of your book. You'll need it for almost every step of this process. You'll also need to identify how you'll publish (book, e-book, both?) and the price for each of those platforms.
1. Establish a Publishing Company (Optional)
Creating a publishing company is a simple as registering a business or local trade entity/name at your town hall office. You can also scale up to a larger business however the local trade establishes your publishing brand as "Publishing Company Books" or whatever name you'd like.
2. Register for your ISBN number
The ISBN number is a unique identifier for your book. It is widely used throughout every library and online store to catalog your book. ISBNs should be purchased through Bowker. Don't buy them anywhere else, if you do, they tend to be third parties just buying them from Bowker anyway. If you plan on publishing more than 1 book, I'd recommend buying a block of 10.
iammilton82 / memorySizeOfObject.js
Created January 7, 2017 17:35
calculate memory size of javascript object, it is not a accurate value!
function memorySizeOf(obj) {
var bytes = 0;
function sizeOf(obj) {
if(obj !== null && obj !== undefined) {
switch(typeof obj) {
case 'number':
bytes += 8;
case 'string':
iammilton82 / 2016-10-21
Last active October 21, 2016 15:34
Share + Tell
Google Pixel -
Cybathlon 2016 (Zurich) -
SlideBot -
iammilton82 / nodejs.txt
Last active April 17, 2016 04:39
NodeJS Tutorials + Notes
Build a RESTful API:
iammilton82 / mailgun-sample.php
Created April 17, 2016 04:21
Mailgun APi Sample
class Mailgun {
function post($headers, $url, $data){
$handle = curl_init();
curl_setopt($handle, CURLOPT_URL, $url);
curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_POST, true);
curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
iammilton82 / wp-pods-vs-ee.php
Created November 25, 2015 15:48 — forked from raybrownco/wp-pods-vs-ee.php
This file is a comparison between WordPress/Pods and ExpressionEngine. It shows the syntax required to display a list of three featured books on a site's homepage.
<!-- Featuring three books on a site's homepage -->
<!-- The Pods/WordPress way -->
<ul id="featured-books">
$book = new Pod('book');
$params = array(
'where'=>'t.show_on_homepage = 1',
iammilton82 / controller.js
Last active October 15, 2015 15:59
AngularJS Pagination
$scope.pagination = {
currentPage: 0,
itemsPerPage: 10,
maxItems: 0,
maxPages: 1,
$scope.pagination.nextPage = function(){
if($scope.pagination.currentPage >= 0){
$scope.pagination.currentPage = $scope.pagination.currentPage + 1;