Skip to content

Instantly share code, notes, and snippets.

View tonyoconnell's full-sized avatar

Tony O'Connell tonyoconnell

View GitHub Profile
var gulp = require('gulp'), // Gulp
jade = require('gulp-jade'), // Jade
stylus = require('gulp-stylus'), // Stylus
autoprefixer = require('gulp-autoprefixer'), // Autoprefixer
csso = require('gulp-csso'), // CSSO
imagemin = require('gulp-imagemin'), // Imagemin
concat = require('gulp-concat'), // Concat
cache = require('gulp-cache'); // Cache
browsersync = require('browser-sync'); // Browser-Sync
a {
text-indent:-999em;
outline:none;
background: url(button.jpg) no-repeat 0 0;
width:100px; height:50px;
display:block;
}
@tonyoconnell
tonyoconnell / gist:5563176
Created May 12, 2013 11:08
magento autologin
// => if you know the customer id
$customer = Mage::getModel('customer/customer')->load($id);
// => if you know the customer email address
$customer = Mage::getModel('customer/customer')->loadByEmail('[email protected]');
if($customer->getId())
{
Mage::getSingleton('customer/session')->setCustomerAsLoggedIn($customer);
}
@tonyoconnell
tonyoconnell / gist:4988720
Created February 19, 2013 18:49
git clean
git clean -f
If you want to also remove directories, run git clean -f -d.
If you just want to remove ignored files, run git clean -f -X.
If you want to remove ignored as well as non-ignored files, run git clean -f -x.
Note the case difference on the X for the two latter commands.
Unless you specify -f and clean.requireForce is set to "true" (the default) in your configuration, nothing will actually happen, with a recent enough version of git.
<button class="button" onclick="window.location='/new' "><span><span>Read More</span></span></button></div>
@tonyoconnell
tonyoconnell / gist:3714057
Created September 13, 2012 12:40
Magento : Add static block to PHTML
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('MYBLOCK')->toHtml() ?>
@tonyoconnell
tonyoconnell / gist:3699551
Created September 11, 2012 15:13
Magento Customer Name
<?php echo $this->__(Mage::getSingleton('customer/session')->getCustomer()->getName()); ?>
@tonyoconnell
tonyoconnell / gist:3696197
Created September 11, 2012 05:35
Insert Static Blocks into Template Files
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('your_cms_block_identifier')->toHtml() ?>
@tonyoconnell
tonyoconnell / gist:3692081
Created September 10, 2012 16:52
Embed a page
{{block type="cms/page" page_id="your-cms-page-id" template="cms/content.phtml"}}
@tonyoconnell
tonyoconnell / gist:3337662
Created August 13, 2012 07:12
Featured carosel
<p class="featured-social">{{block type="catalog/product_list" category_id="49" template="catalog/product/featured.phtml"}}</p>