Skip to content

Instantly share code, notes, and snippets.

View iammilton82's full-sized avatar

Milton Jackson iammilton82

View GitHub Profile
@iammilton82
iammilton82 / MY_Upload.php
Created March 6, 2014 19:18
MultiFile Upload function in CodeIgniter
<!-- LIBRARY -->
<?
if (!defined('BASEPATH')) exit('No direct script access allowed');
class MY_Upload extends CI_Upload {
function uploadmultiple($files, $settings)
{
$uploaded = array();
<?php
public function getEmbedCode($url)
{
if (strpos($url, 'youtube') !== FALSE) {
$url_parts = parse_url($url);
parse_str($url_parts['query'], $segments);
return '//www.youtube.com/embed/' . $segments['v'];
} else if (strpos($url, 'vimeo') !== FALSE) {

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@iammilton82
iammilton82 / print-and-console.php
Created August 8, 2015 19:57
Print array and console
public function printIt($data){
echo "<pre>";
print_r($data);
echo "</pre>";
}
public function console($data){
$data = json_encode($data);
echo "<script type='text/javascript'>console.log($data)</script>";
}
@iammilton82
iammilton82 / links.html
Last active September 1, 2015 12:30
Helpful AngularJS links
@iammilton82
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;
@iammilton82
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">
<?php
$book = new Pod('book');
$params = array(
'where'=>'t.show_on_homepage = 1',
@iammilton82
iammilton82 / fixedcss.css
Last active December 17, 2015 11:19
Fixed scrolling navigation
/* CSS */
body { padding-top:80px; } /* be sure the padding is fron the top of the page to the top of your content */
#header { position: absolute; height:50px; width: 100%; top:20px; left:0; right:0; }
#header.fixed { position: fixed; top:0; }
@iammilton82
iammilton82 / forcelinks.js
Created May 28, 2013 17:51
Force IOS web app links to open in same document
@iammilton82
iammilton82 / the-events-calendar.php
Created August 31, 2013 12:23
Events Loop for The Events Calendar
<?
global $post;
$events = new WP_Query();
$events->query( array('post_type'=> 'tribe_events', 'eventDisplay' => 'all', 'posts_per_page' => 3));
if ( $events->have_posts() ){
echo "<ul>";
while ( $events->have_posts() )
{