Skip to content

Instantly share code, notes, and snippets.

<?php
// http://www.leofs.org/docs/s3_client.html
// i used composer with the following composer.json file and then called composer install
// {"require":{"aws/aws-sdk-php": "2.*"}}
require "vendor/autoload.php";
use Aws\Common\Enum\Region;
use Aws\S3\S3Client;
@Abban
Abban / jigoshop-export.sql
Last active August 29, 2015 14:28
Export Jigoshop Products
SELECT
p.post_title AS title,
p.post_content AS description,
p.post_excerpt AS excerpt,
p.ID AS jigoshop_id,
IFNULL(pmp.meta_value, "") AS price,
IFNULL(pmp.meta_value, "") AS original_price,
IFNULL(pmw.meta_value, "") AS weight,
IFNULL(pms.meta_value, "") AS inventory,
IFNULL(pmsk.meta_value, "") AS sku,
@Abban
Abban / WP Theme support post thumbnails
Created June 21, 2012 14:39
WP - Theme Support Post Thumbnails
add_theme_support('post-thumbnails');
set_post_thumbnail_size(732, 9999);
add_image_size('slideshow', 800, 9999);
add_image_size('thumb-pic', 115, 90, TRUE);
@Abban
Abban / WP - Meta Links List.php
Created June 23, 2012 18:24
WP - Meta links list
@Abban
Abban / hijack-thickbox.js
Created July 16, 2012 13:18
WP: Hijack Thickbox
$('.add-file').live('click', function(){
formfield = $('#' + $(this).attr('id') + '_field');
// show the thickbox
tb_show( $(this).val() , fab_admin_url + 'media-upload.php?post_id=' + fab_post_id + '&type=file&acf_type=file&TB_iframe=1');
return false;
});
@Abban
Abban / custom-fields.css
Created July 26, 2012 13:14
WP: Custom Metabox Code
#fabfolio_options .inside{
margin:0;
}
#fabfolio_options .inside >div p{
margin: 0 -10px;
padding: 10px 10px 20px;
border-bottom: 1px solid #ccc;
border-top: 1px solid #fff;
}
#fabfolio_options .inside >div p:last-child{
@Abban
Abban / Icon font less mixin
Created October 2, 2012 10:09
CSS: Icon Font Mixin
// Mixin
.icon(@char){
font-family: 'Pictos Custom';
content: @char;
-webkit-font-smoothing: antialiased;
text-transform:none;
font-size: 1.5em;
vertical-align:middle;
font-weight: normal;
@Abban
Abban / Box-Sizing.js
Created January 9, 2013 15:30
Adds Modernizr test for boxsizing then a jQuery element width edit for browsers that don't support it.
/**
* Add Modernizr test for box sizing
*/
Modernizr.addTest("boxsizing", function(){
return Modernizr.testAllProps("boxSizing") && (document.documentMode === undefined || document.documentMode > 7);
});
/**
* Change the width of all elements to account for border-box
*/
// Use absolute URLs to navigate to anything not in your Router.
// Only need this for pushState enabled browsers
if (Backbone.history && Backbone.history._hasPushState) {
// Use delegation to avoid initial DOM selection and allow all matching elements to bubble
$(document).delegate("a", "click", function(evt) {
// Get the anchor href and protcol
var href = $(this).attr("href");
var protocol = this.protocol + "//";
@Abban
Abban / is_ajax.php
Created January 30, 2013 12:32
CodeIgniter function that catches if the current request is an Ajax one.
<?php
/**
* Is Ajax
*
* Returns true or false depending on if the http request was an ajax one or not.
*
* @return boolean
*/
if(!function_exists('is_ajax')){