This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// quit script if you aren't accessing it with ajax | |
if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) == false){ | |
die(); | |
} | |
// include database class | |
include('database.class.php'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Base_controller extends CI_Controller { | |
function __construct(){ | |
parent::__construct(); | |
} | |
function _page($view,$data = false){ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function(){ | |
fixConsole(); | |
console.log('yo waddup'); | |
}); | |
function fixConsole(){ | |
var iframe = document.createElement('iframe'); | |
iframe.style.display = 'none'; | |
document.body.appendChild(iframe); | |
window.console = iframe.contentWindow.console; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# dogs is the text every other user will see. | |
# "cats" is what the developer sees... | |
# This way, only the developer can see changes, and if they want to show the client, they can. | |
?> | |
<h1>Heading!</h1> | |
<p>This is some text about <?php if(!isset($_GET['dev'])): ?>dogs<?php else: ?>cats<?php endif; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var elems = document.getElementsByTagName('*'); | |
for(var i=-1;++i<elems.length;){ | |
elems[i].style.fontFamily='"Comic Sans MS", "Comic Sans", cursive'; | |
} | |
})(); | |
// as a bookmarklet | |
javascript:(function(){var elems=document.getElementsByTagName('*');for(var i=-1;++i<elems.length;){elems[i].style.fontFamily='"Comic Sans MS", "Comic Sans", cursive';}})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getCategoryImage($category) { | |
$categoryCollection = Mage::getModel('catalog/category')->setStoreId(Mage::app()->getStore()->getId())->getCollection()->addAttributeToSelect('image')->addIdFilter($category->getId()); | |
foreach($categoryCollection as $category) { | |
return $category->getImageUrl(); | |
} | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Really useful for echoing with CI | |
*/ | |
function generate_thumbnail($filename, $thumb_width, $thumb_height){ | |
$path = 'uploads/'.$filename; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function expect(value){ | |
return { | |
val: value, | |
toBe: function(that){ | |
if(this.val == that) return true; | |
else return false; | |
} | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#blueBar { | |
background: -webkit-linear-gradient(#444, #111); | |
border-bottom: 1px solid #000; | |
border-top: 1px solid black; | |
box-shadow: 0 0 30px rgba(0,0,0,0.8) ; | |
height: auto; | |
position: fixed; | |
} | |
#blueBar a:hover { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
var currentOrderID = $('.nav .current a').parent().index() | |
$('[data-ajax]').on('click', 'a', function(e){ | |
var target = $(e.target), | |
animSpeed = 200, | |
url = target.attr('href'), | |
newOrderID = target.parent().index() | |
OlderNewer