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 Stereo_Catalog_Block_Product_Featured extends Mage_Catalog_Block_Product_Abstract | |
{ | |
protected $_productsCount = null; | |
const DEFAULT_PRODUCTS_COUNT = 12; | |
protected function _beforeToHtml() | |
{ |
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 | |
/** | |
* 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 |
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
module YourApp | |
class Application < Rails::Application | |
# ... | |
config.middleware.insert_before "Rack::Cache", "SubdomainRedirect" | |
# ... | |
end | |
end |
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
class ApplicationController < ActionController::Base | |
before_filter :prepend_view_path_if_mobile | |
def mobile_request? | |
@mobile_request ||= (request.subdomains.first == domain_prefixes[:mobile]) | |
end | |
helper_method :mobile_request? | |
def prepend_view_path_if_mobile | |
prepend_view_path Rails.root + 'app' + 'views_mobile' if mobile_request? |
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
<body class="overview"> | |
<section class="overview-section engage-section"> | |
<h1 class="overview-section-header engage-section-header">xxx</h1> | |
</section> | |
<section class="overview-section measure-section"> | |
<h1 class="overview-section-header measure-section-header">xxx</h1> | |
</section> | |
</body> |
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
/* Modernizr 2.6.2 (Custom Build) | MIT & BSD | |
* Build: http://modernizr.com/download/#-cssanimations-csstransforms3d-shiv-mq-cssclasses-teststyles-testprop-testallprops-prefixes-domprefixes-load | |
*/ | |
;window.Modernizr=function(a,b,c){function A(a){j.cssText=a}function B(a,b){return A(m.join(a+";")+(b||""))}function C(a,b){return typeof a===b}function D(a,b){return!!~(""+a).indexOf(b)}function E(a,b){for(var d in a){var e=a[d];if(!D(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function F(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:C(f,"function")?f.bind(d||b):f}return!1}function G(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return C(b,"string")||C(b,"undefined")?E(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),F(e,b,c))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t |
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
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' | |
ZSH_THEME_GIT_PROMPT_PREFIX="[%{$fg[red]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}] %{$fg[yellow]%}✗%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}]" |
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
# if you want to monkey patch every controller, put this in initializers/active_admin.rb | |
ActiveAdmin::ResourceController.class_eval do | |
include ActiveAdmin::CSVStream | |
end |
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
module ActiveAdmin | |
module Reports | |
module DSL | |
def enable_reports | |
action_item only: :index do | |
link_to("Download", {action: :report, params: params}, {method: :post, data: { confirm: "Are you sure you want to generate this report?"}}) | |
end | |
collection_action :report, method: :post do |
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
module Paperclip | |
module CopyAttachments | |
def copy_attachments_from(source_obj, source_bucket = nil, destination_bucket = nil) | |
self.class.attachment_definitions.keys.each do |attachment_name| | |
source_attachment = source_obj.send(attachment_name) | |
next if source_attachment.blank? | |
destination_attachment = self.send(attachment_name) | |
connection = destination_attachment.send(:connection) |
OlderNewer