This file contains hidden or 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
<script type="text/javascript" charset="utf-8"> | |
function imprimir(){ | |
var objeto=document.getElementById('div_imprimir'); //obtenemos el objeto a imprimir | |
var ventana=window.open('','_blank'); //abrimos una ventana vacía nueva | |
ventana.document.write(objeto.innerHTML); //imprimimos el HTML del objeto en la nueva ventana | |
ventana.document.write('<link rel="stylesheet" href="/static/css/mi_hoja1.css">'); // incluyes los css | |
ventana.document.write('<link rel="stylesheet" href="/static/css/mi_hoja2.css">'); // incluyes los css | |
ventana.document.close(); //cerramos el documento |
This file contains hidden or 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 number = 46786.62; | |
// sin parámetros será el formato por defecto de tu navegador | |
console.log("Formato automático --- " + number.toLocaleString()); | |
// le puedes pasar un código de locale específico | |
console.log("Formato en EE.UU. ---- " + number.toLocaleString("en-US")); | |
console.log("Formato de España ---- " + number.toLocaleString("es-ES")); |
This file contains hidden or 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
/* cardNumber | |
* Recibe numero de tarjeta en int o str | |
* Return the true or false. | |
*/ | |
function cardNumber(num) { | |
num = num.toString(); | |
console.log('\nIn Function ' + num); | |
var visa = /^(?:4[0-9]{12}(?:[0-9]{3})?)$/; |
This file contains hidden or 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 addTogether(x) { | |
console.log("\n"); | |
console.log("In function" + arguments.length); | |
if(arguments.length==2 && typeof arguments[0] === "number" && typeof arguments[1] === "number"){ | |
var sum = arguments[0] + arguments[1]; | |
return sum; | |
}else{ | |
This file contains hidden or 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 | |
# obtenemos el HASH del commit de MASTER | |
master=$(cat .git/refs/heads/master) | |
echo $master | |
if [ ${#master} = 0 ]; then | |
echo "Imposible encontrar .git/refs/heads/master" | |
fi |
This file contains hidden or 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
version: 0.2 | |
phases: | |
build: | |
commands: | |
- aws s3 cp s3://deployment.script/build.sh build.sh | |
- chmod -R +x build.sh | |
- ./build.sh |