Skip to content

Instantly share code, notes, and snippets.

View juanchehin's full-sized avatar

Juan Chehin juanchehin

View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.ionic.starter">
<application
android:allowBackup="true"
android:cleartextTrafficPermitted="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
import { Request, Response, NextFunction, response } from 'express';
import pool from '../database';
const bcrypt = require('bcrypt');
const nodemailer = require("nodemailer");
import keys from '../keys';
// const path = require('path');
class ClientesController {
// ==================================================
public async webhook(req: Request, res: Response) {
if (req.query.type === 'payment') {
const paymentId = req.query['data.id'];
console.log("paymentId: ",paymentId)
var options = {
'method': 'GET',
'hostname': 'api.mercadopago.com',
function get_rows_gastos_fecha()
{
//before_send();
table_body.html("<tr><td colspan='<?=sizeof($this->columns)?>' style='font-weight:600;text-align:center'>Espere...</td></tr>");
var fechaGasto = document.getElementById("fecha-gasto").value;
console.log("table_body row 11 : ",table_body);
-- chequear permiso
IF NOT EXISTS (SELECT IdPermiso FROM permisos_persona WHERE (IdPermiso = 1 or IdPermiso = 61) AND (IdPersona = pIdUsuario)) THEN
SELECT 'No tienes los permisos suficientes para realizar esta accion' AS Mensaje;
LEAVE SALIR;
END IF;
SALIR:BEGIN
/*
Permite ....
*/
DECLARE pPrecioCompra decimal;
DECLARE pStock,pIdSucursal int;
-- Manejo de error en la transacción
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
SHOW ERRORS;
// ==================================================
// Lista
// ==================================================
altaVenta(req: Request, res: Response) {
var pIdVendedor = req.params.IdPersona;
var pIdCliente = req.body[0];
@juanchehin
juanchehin / example-json
Created June 17, 2023 00:00
Ejemplo de JSON para tomar notas de endpoints de API 
{
api_endpoints: {
sign_up: {
url: 'mywebsite.com/auth/sign_up',
method: 'POST',
shape: {
username: { type: String, required: true, min: 6, max: 18 },
password: { type: String, required: true, min: 6: max 32 },
referralCode: { type: String, required: true, min: 64, max: 64 }
}
@juanchehin
juanchehin / caso-xss
Created June 28, 2023 20:39
XSS: Caso de uso malicioso
<script>
/*
* Get a list of all customers from the page.
*/
const customers = document.querySelectorAll('.openCases');
/*
* Iterate through each DOM element containing the openCases class,
* collecting privileged personal identifier information (PII)
* and store that data in the customerData array.
*/
<?php if ($_SERVER['REQUEST_METHOD'] != 'POST') {
echo'
<div class="row">
<div class="small-12 columns">
<form method="post" action="">
<fieldset class="panel">
<center>
<h1>Sign In</h1><br>
</center>
<label>