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
let arr_mes = [1, 2, 3, 4, 5, 6, 7]; | |
let producto = [{ | |
producto: 'ALEBINO DE PECES', | |
items: [ | |
{mes: 1, importe: '400', is_mayor: false}, | |
{mes: 6, importe: '200', is_mayor: false} | |
] | |
}, | |
{ | |
producto: 'PRODUCTO 2', |
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
import pymysql | |
import pandas as pd | |
import math | |
import logging | |
LOG_FILE = "logging.log" | |
logging.basicConfig(filename=LOG_FILE,level=logging.DEBUG,format='%(asctime)s %(message)s', datefmt='%d/%m/%Y %H:%M:%S') | |
try: | |
def set_log(e, block): |
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 crearPersona(nombre, apellido) { | |
// return { nombre, apellido }; | |
// } | |
const crearPersona = (nombre, apellido) => ({ nombre, apellido }); | |
const persona = crearPersona("Brayan", "Pastor"); | |
console.log(persona); | |
function imprimeArgumentos() { |
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 | |
public static function updateValues(array $values) | |
{ | |
$table = MyModel::getModel()->getTable(); | |
$cases = []; | |
$ids = []; | |
$params = []; | |
foreach ($values as $id => $value) { |
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
```sh | |
https://ww1.essalud.gob.pe/sisep/postulante/postulante/postulante_obtenerDatosPostulante.htm?strDni=46879999 | |
``` | |
```sh | |
curl 'http://aplicaciones007.jne.gob.pe/srop_publico/Consulta/api/AfiliadoApi/GetNombresCiudadano' -H 'RequestVerificationToken: 30OB7qfO2MmL2Kcr1z4S0ttQcQpxH9pDUlZnkJPVgUhZOGBuSbGU4qM83JcSu7DZpZw-IIIfaDZgZ4vDbwE5-L9EPoBIHOOC1aSPi4FS_Sc1:clDOiaq7mKcLTK9YBVGt2R3spEU8LhtXEe_n5VG5VLPfG9UkAQfjL_WT9ZDmCCqtJypoTD26ikncynlMn8fPz_F_Y88WFufli38cUM-24PE1' -H 'Content-Type: application/json;chartset=utf-8' --data-binary '{"CODDNI":"46658592"}'; | |
``` |
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 | |
======= | |
public function readImage() | |
{ | |
header('Content-type: image/jpeg'); | |
echo file_get_contents("http://app1.susalud.gob.pe/registro/Home/GeneraCaptcha?accion=image"); | |
} | |
=================================================================================================== | |
JS | |
======= |
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
<script type="text/javascript"> | |
window.addEventListener("load", function(e) { | |
let templete = document.getElementById("article-template"); | |
let articles = document.getElementById("articles"); | |
for (let i = 1; i <= 5; i++) { | |
let clonar = templete.cloneNode(true); | |
clonar.removeAttribute("id"); | |
let h2 = clonar.getElementsByTagName("h2")[0]; | |
h2.innerHTML = h2.textContent + " " + i; | |
articles.appendChild(clonar); |
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 | |
include "fpdf/fpdf.php"; | |
$pdf = new FPDF($orientation='P',$unit='mm', array(45,350)); | |
$pdf->AddPage(); | |
$pdf->SetFont('Arial','B',8); //Letra Arial, negrita (Bold), tam. 20 | |
$textypos = 5; | |
$pdf->setY(2); | |
$pdf->setX(2); | |
$pdf->Cell(5,$textypos,"NOMBRE DE LA EMPRESA"); |
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
$original = array | |
( | |
array | |
( | |
"dni" => 98989898, | |
"email" => "edgra@gmail.com", | |
"date" => "2016-09-02 20:58:53", | |
"items" => 7 | |
), |
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
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.0/knockout-min.js"></script> | |
<script> $(document).ready(() => { | |
ko.bindingHandlers.nextEnter = { | |
init: function (element, valueAccessor, allBindingsAccessor) { | |
$(element).on('keydown', 'input, select', function (e) { | |
var self = $(this), form = $(element), focusable, next; | |
if (e.keyCode == 13) { | |
focusable = form.find('input,a,select,button,textarea').filter(':visible'); | |
var nextIndex = focusable.index(this) == focusable.length - 1 ? 0 : focusable.index(this) + 1; | |
next = focusable.eq(nextIndex); |
NewerOlder