Skip to content

Instantly share code, notes, and snippets.

View iamnoah's full-sized avatar

Noah Perks Sloan iamnoah

  • Texas
  • 00:36 (UTC -05:00)
View GitHub Profile
<div class="product" >
<g:link action="show" id="${productInstance.id}">
<h3>
${productInstance.name}
(${productInstance.id})
</h3>
</g:link>
<div class="image">
def list = {
[:]
}
def renderList = {
params.max = Math.min(params.max ? params.int('max') : 10, 100)
[productIds: Product.list(params)*.id, productInstanceTotal: Product.count()]
}
def renderProduct = {
import groovy.xml.MarkupBuilder;
class FrameworkTagLib {
static namespace = "ajax"
def include = { attrs ->
def controller = attrs.controller, action = attrs.action, id = attrs.id
def component = "${controller}-${action}" + (id ? "-${id}" : "")
<div class="paginateButtons paginateTop">
<g:paginate total="${productInstanceTotal}" />
</div>
<div class="list">
<g:each in="${productIds}">
<g:include controller="product" action="renderProduct" id="${it}" />
</g:each>
</div>
<div class="paginateButtons">
<g:paginate total="${productInstanceTotal}" />
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="layout" content="main" />
<g:set var="entityName" value="${message(code: 'product.label', default: 'Product')}" />
<title><g:message code="default.list.label" args="[entityName]" /></title>
</head>
<body>
<div class="nav">
<span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
var grailsAjax = {
refresh: function(target,params,cb) {
var component = $(target).parents('.ajax-component:first');
if(!component.length) throw "Error: target does not belong to an ajax component"
var path = '../'+component.attr('id').replace(/-/g,'/');
component.load(path,params,cb);
}
};
$(function() {
$('.body').delegate('.list a.color','click',function () {
var data = this.href.split(/\?/)[1];
grailsAjax.refresh(this,data);
return false;
});
});
$('.body').delegate('.prevLink, .step, .nextLink','click',function () {
var data = this.href.split(/\?/)[1];
grailsAjax.refresh(this,data);
return false;
});
<?php
$magePath = 'app/Mage.php';
require_once $magePath;
umask(0);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$types = array("config", "layout", "block_html", "translate", "collections", "eav", "config_api", "full_page");
foreach($types as $type) {
Mage::app()->getCacheInstance()->cleanType($type);
}
SERVER=yourdevserver.com
CODE_DIR=/var/www/html/
git diff | ssh $SERVER -C "cd $CODE_DIR; patch -p1"