Skip to content

Instantly share code, notes, and snippets.

@davidalexander
davidalexander / gist:1086455
Last active July 12, 2024 07:05
Magento Snippets

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

@dz0ny
dz0ny / Capfile.rb
Created May 5, 2012 19:29
FTP Sync for Capistrano
load 'config/deploy'
desc "FTP Sync"
namespace :deploy do
desc "Sync and compile to remote by default"
task :default do
#assets.sprite
#assets.compile
remote.default
@joshbeckman
joshbeckman / animatedScrollTo.js
Created September 30, 2013 14:51
ScrollTo animation using pure javascript and no jquery
document.getElementsByTagName('button')[0].onclick = function () {
scrollTo(document.body, 0, 1250);
}
function scrollTo(element, to, duration) {
var start = element.scrollTop,
change = to - start,
currentTime = 0,
increment = 20;
@natelandau
natelandau / .bash_profile
Last active November 10, 2024 21:53
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@hans2103
hans2103 / price.phtml M1.9
Last active October 23, 2018 17:47
Implementation of structured data itemprop=price on app/design/frontend/<your_package>/<your_theme>/template/catalog/product/price.phtml - Magento 1.9.0.x - http://schema.org/Offer - more information: http://www.byte.nl/blog/magento-rich-snippets-made-easy/
<?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
@magicznyleszek
magicznyleszek / css-selectors.md
Last active November 2, 2024 12:22
CSS Selectors Cheatsheet

CSS Selectors Cheatsheet

Hi! If you see an error or something is missing (like :focus-within for few years :P) please let me know ❤️

Element selectors

Element -- selects all h2 elements on the page

h2 {
@anupdugar
anupdugar / OauthClient.php
Created January 12, 2015 07:11
Scripts to demo Magento 2 Oauth1.a token exchange
<?php
use OAuth\Common\Consumer\Credentials;
use OAuth\Common\Http\Client\ClientInterface;
use OAuth\Common\Http\Exception\TokenResponseException;
use OAuth\Common\Http\Uri\Uri;
use OAuth\Common\Http\Uri\UriInterface;
use OAuth\Common\Storage\TokenStorageInterface;
use OAuth\OAuth1\Service\AbstractService;
use OAuth\OAuth1\Signature\SignatureInterface;
var CSV = require('oh-csv');
process.stdout.write(
'<?xml version="1.0" encoding="UTF-8"?>' + '\r\n' +
'<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"' + '\r\n' +
' xmlns:dsq="http://www.disqus.com/" xmlns:dc="http://purl.org/dc/elements/1.1/"' + '\r\n' +
' xmlns:wp="http://wordpress.org/export/1.0/">' + '\r\n' +
' <channel>' + '\r\n'
);
sudo pip install -I ansible==1.9.0.1
@peterjaap
peterjaap / Observer.php
Created June 2, 2015 10:34
Fixed Orchid_CouponFix_Model_Observer for Magento 1.7+
<?php
class Orchid_CouponFix_Model_Observer
{
public function cancel($observer)
{
$resource = Mage::getModel('core/resource');
$db = $resource->getConnection('core_write');
$event = $observer->getEvent();
$order = $event->getPayment()->getOrder();
if ($order->canCancel()) {