Skip to content

Instantly share code, notes, and snippets.

View amacgregor's full-sized avatar
:shipit:
Working on Side Projects

Allan MacGregor amacgregor

:shipit:
Working on Side Projects
View GitHub Profile
root@ubuntu:~/Development/Teambox# gem install SystemTimer
Building native extensions. This could take a while...
ERROR: Error installing SystemTimer:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
creating Makefile
make
gcc -I. -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -fPIC -O2 -g -Wall -Wno-parentheses -o system_timer_native.o -c system_timer_native.c
<?php
class Expertmagento_Adminhtml_Block_Tabs extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs
{
protected function _prepareLayout()
{
parent::_prepareLayout();
$this->addTab('knowledgebase', array(
'label' => Mage::helper('catalog')->__('Knowledge Base Articles'),
'content' => 'Success',
));
C:\Users\amacgregor>gem install RedCloth
Building native extensions. This could take a while...
ERROR: Error installing RedCloth:
ERROR: Failed to build gem native extension.
C:/Ruby192/bin/ruby.exe extconf.rb
creating Makefile
make
C:/Ruby192/bin/ruby -e "puts 'EXPORTS', 'Init_redcloth_scan'" > redcloth_scan-i386-mingw32.def
@amacgregor
amacgregor / _form.haml
Created May 19, 2011 22:19
snippets.rb
.group
=f.label :title
=f.error_message_on :title
=f.text_field :title, :class => :text_field
%span.description Ex: a simple text
.group
=f.label :code
=f.error_message_on :code
~f.text_area :code, :class => :text_area
@amacgregor
amacgregor / configurable.phtml
Created June 8, 2011 13:42
configurable.phtml
<?php
/**
* Magento Commercial Edition
*
* NOTICE OF LICENSE
*
* This source file is subject to the Magento Commercial Edition License
* that is available at: http://www.magentocommerce.com/license/commercial-edition
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
@amacgregor
amacgregor / scp_product_extend.js
Created June 8, 2011 13:47
scp_product_extend.js
/*
Some of these override earlier varien/product.js methods, therefore
varien/product.js must have been included prior to this file.
*/
Product.Config.prototype.getMatchingSimpleProduct = function(){
var inScopeProductIds = this.getInScopeProductIds();
if ((typeof inScopeProductIds != 'undefined') && (inScopeProductIds.length == 1)) {
return inScopeProductIds[0];
}
<script type="text/javascript">
var spConfig = new Product.Config({"attributes":{"149":{"id":"149","code":"test_attribute","label":"Configurable Option","options":[{"id":"3","label":"Option 1","oldPrice":"0","products":["6"]},{"id":"4","label":"Option 2","oldPrice":"0","products":["7"]}]}},"template":"$#{price}","basePrice":"50","oldPrice":"50","productId":"8","chooseText":"Choose an Option...","taxConfig":{"includeTax":false,"showIncludeTax":false,"showBothPrices":false,"defaultTax":0,"currentTax":0,"inclTaxTitle":"Incl. Tax"},"childProducts":{"7":{"price":"150","finalPrice":"150","productName":"Test Configurable Product (simple2)","description":"Test Configurable Product (simple2)","shortDescription":"Test Configurable Product (simple2)","productAttributes":"\n<div class=\"box-collateral-inner box-additional-inner\">\n <h2>Tabs<\/h2>\n <tbody>\n <tr>\n <div id=\"tabs\">\n <ul>\n \n <li>\n <a href=\"#tabs-tab_description\
@amacgregor
amacgregor / media.phtml
Created June 10, 2011 20:42
Media Phtml file
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
@amacgregor
amacgregor / ProductController.php
Created June 13, 2011 14:01
Core Product controller for magento
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
@amacgregor
amacgregor / Rakefile
Created June 18, 2011 21:10
Rakefile
require 'resque/tasks'
QUEUE=* rake resque:work