Skip to content

Instantly share code, notes, and snippets.

@jsiesquen
jsiesquen / vtexCheckoutEvents.js
Created April 28, 2019 03:19 — forked from rgoytacaz/vtexCheckoutEvents.js
Examples of events in VTEX Checkout
(function(){
$('#shipping-data').on('enable.vtex', function(){
console.log('Shipping Data just opened.');
});
$(window).on('orderFormUpdated.vtex', function(ev, orderForm) {
console.log('Order Form updated.');
});
@jsiesquen
jsiesquen / request-promise-native.js
Last active December 20, 2018 15:36
Using request-promise-native module include within a constructor Lambda. Check https://stackoverflow.com/questions/50468120/nodejs-request-get-body
let msurls = ["http://example.org", "http://example.org"]
let request = require ("request-promise-native")
async function doRequests () {
    return await (Promise.all (
        msurls.map (async msurl => await request (msurl)))
    )
}
doRequests (). then (msresult => console.log (msresult))
@jsiesquen
jsiesquen / request-promise-native.js
Created December 20, 2018 15:34
Using request-promise-native module include within a constructor Lambda.
let msurls = ["http://example.org", "http://example.org"]
let request = require ("request-promise-native")
async function doRequests () {
    return await (Promise.all (
        msurls.map (async msurl => await request (msurl)))
    )
}
/* */
@jsiesquen
jsiesquen / index.js
Created December 18, 2018 22:07
Sample code using request-promise on nodeJs
const rp = require('request-promise');
const rq = require('request');
require('dotenv').config();
let endpointFeed = `https://domain.com/feed/orders/status?limit=10`;
let endpointOrderSeller = `https://domain.com/orders/`;
let requestConfiguration = {
method: 'GET',
json: true,
@jsiesquen
jsiesquen / webserver.py
Created September 27, 2018 15:12 — forked from MarkusHackspacher/webserver.py
Python Webserver GUI
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Webserver für Python
03.01.2014 MH Quelltext für Python 2.7 und 3.x
30.05.2013 MH Quelltext nach PEP8 überprüft
http://creativecommons.org/licenses/by-nc-sa/3.0/de/
"""
try:
import Tkinter as tk
#!/usr/bin/python
# -*- coding: utf-8 -*-
""" DMLogger """
import tkinter as tk
import tkinter.scrolledtext as tkscrolledtext
import http.server as httpserver
import _thread as thread
import sqlite3
import json
from urllib import parse
@jsiesquen
jsiesquen / prestashop.conf
Created May 30, 2018 23:02 — forked from julienbourdeau/prestashop.conf
PrestaShop Nginx Configuration
server {
listen 80;
listen [::]:80; #Use this to enable IPv6
server_name www.example.com;
root /var/www/prestashop17;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
index index.php index.html;
<?php
/**
* Class for complete the numbers from an input range
* Restrictions:
* - Letters are invalids, number only please.
* - If add negative numbers these are remove and
* the result init from a positive number like 1.
* - If add the zero number the result is empty string.
* Execution using:
* - From Code Inside, instance from Class:
<?php
/**
* Class for extract chars paring
* Support:
* On PHP 5.x
* Execution using:
* - From Code Inside, instance from Class:
* $cp = new ClearPar();
* echo $cp->build('(()()()()(()))))())((())');
*/
<?php
header('Content-Type: text/html; charset=ISO-8859-1');
/**
* Class for convert letters from an input string
* Restrictions:
* - Work with latin alfhabet, except tilde letters.
* - No depend of setting of "Regional Configuration".
* Execution using:
* - From Console: