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
{ | |
"toc": true, | |
"merchant": { | |
"confirmation_url": "https://demo.aplazame.com/confirm", | |
"cancel_url": "/demo-cancel.html", | |
"success_url": "/demo-success.html" | |
}, | |
"customer": { | |
"id": "140", | |
"email": "[email protected]", |
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
.tree-view { | |
font-family: 'Souce Sans Pro', 'Ubuntu Mono', Monaco, monospace; | |
font-size: 17px !important; | |
.list-tree .entry { | |
line-height: 1.5; | |
.name { | |
color: #aaa; | |
} |
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
var arrayShift = [].shift; | |
function _deep_merge (dest, src) { | |
if( typeof dest !== typeof src ) { | |
return src; | |
} | |
if( src instanceof Array ) { | |
[].push.apply(dest, src); | |
return dest; | |
} |
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
{ | |
"host": "location", | |
"toc": true, | |
"merchant": { | |
"confirmation_url": "http://checkout.ovh2.germade.es/success.html", | |
"cancel_url": "/demo-cancel.html", | |
"success_url": "/demo-success.html" | |
}, | |
"customer": { | |
"id": "140", |
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
function compileMessage (message) { | |
return new Function('obj', 'with(obj){ return \'' + | |
message.replace(/\n/g, '\\n').split(/{{([^{}]+)}}/g).map(function (expression, i) { | |
return i%2 ? ( '\'+(' + expression.trim() + ')+\'' ) : expression; | |
}).join('') + | |
'\'; }'); | |
} |
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
function delayed (fn, args) { | |
var _this = this, _args = args || arguments; | |
setTimeout(function () { | |
fn.apply(_this, _args); | |
}, 0); | |
} | |
function once (fn, nextValue) { | |
var result, hasNextValue = arguments.length > 1; | |
return function () { |
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
function once (fn) { | |
var result; | |
return function () { | |
if( fn ) { | |
result = fn.apply(this, arguments); | |
fn = null; | |
} | |
return result; | |
}; | |
} |
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
var request = new XMLHttpRequest(); | |
request.onreadystatechange = function() { | |
if(request.readyState === 4) { | |
if(request.status === 200) { | |
console.log(request.responseText); | |
} else { | |
console.error(request.status, request.statusText, request.responseText); | |
} | |
} |
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 | |
// si tienes instalado php-curl, puedes usar la siguente función: | |
| |
function authorize_order ($aplazame_private_key, $order_id, $is_production = false) { | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, "https://api.aplazame.com/orders/$order_id/authorize"); | |
curl_setopt($ch, CURLOPT_POST, true); | |
// curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); | |
| |
// esto es para no incluir la cabecera de la respuesta |
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
#!/bin/bash | |
# A quick script to install Docker Engine and Compose | |
# Run with sudo | |
# Install Docker Engine | |
curl -sSL https://get.docker.com/ | sh | |
# Start Docker | |
# TODO update to handle multiple distros | |
service docker start |