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/sh | |
parse_yaml() { | |
local prefix=$2 | |
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') | |
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \ | |
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | | |
awk -F$fs '{ | |
indent = length($1)/2; | |
vname[indent] = $2; | |
for (i in vname) {if (i > indent) {delete vname[i]}} |
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
atom-text-editor, :host { | |
background-color: #000000; | |
} | |
// style the background color of the tree view | |
.tree-view { | |
// background-color: whitesmoke; | |
font-size: 1.3rem; | |
font-family: monospace; | |
} |
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
angular.module('web.components', []).factory('webComponent', function ($templateCache, $compile) { | |
function getAttributes (element) { | |
var $attrs = {}, attrs = element.attributes; | |
for( var i = 0, len = attrs.length; i < len ; i++ ) { | |
$attrs[attrs[i].name.replace(/([a-z])-([a-z])/, function (match, a, z) { | |
return a + z.toUpperCase(); | |
})] = attrs[i].value; | |
} | |
return $attrs; |
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
alias ll='ls -alF' | |
alias l='ls -alF' | |
alias c='clear' | |
alias .='echo $PWD' | |
alias ..='cd ..' | |
alias ...='cd ../..' | |
alias ....='cd ../../..' | |
alias .....='cd ../../../..' | |
alias ......='cd ../../../../..' |
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
#!/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 |
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
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
function once (fn) { | |
var result; | |
return function () { | |
if( fn ) { | |
result = fn.apply(this, arguments); | |
fn = null; | |
} | |
return result; | |
}; | |
} |