Skip to content

Instantly share code, notes, and snippets.

@danielcremer
danielcremer / gist:1339098
Created November 4, 2011 11:00
Replacement in Fulfillment Template
<px:keymap map="shipping" key="StandardGround">SG</px:keymap>
<px:keymap map="shipping" key="Overnight">ON</px:keymap>
<shipping>
<px:replace map="shipping"><px:shipping_method /></px:replace>
</shipping>
<!-- OR the following -->
{
"_links": {
"self": { "href": "/todo-list" },
"search": { "href": "/todo-list/search;{searchterm}" },
"description": { "href": "/todo-list/description" }
},
"_embedded": {
"item": [
{
"_links": {
@danielcremer
danielcremer / gist:1301410
Created October 20, 2011 15:20
mock jquery
function ajaxSuccess(execution) {
var original_ajax = $j.ajax
$j.ajax = function(options) {
var response = JSON.parse( ajaxFixtures[options.url] || '{}' );
options['success'].call(this, response)
};
execution.call(this);
console.log('pong');
$j.ajax = original_ajax;
}