Skip to content

Instantly share code, notes, and snippets.

View juque's full-sized avatar

Juan Pablo Aqueveque juque

View GitHub Profile
@juque
juque / layout.html
Created January 26, 2021 18:24
Secciones opcionales dentro de layout
<!doctype html>
<html lang="es">
<head>
<title>{% current_title %} - {{ shop.name }}</title>
{% bootic_header 'v2' %}<!-- carga bootic.css y shops.js -->
{% include_optional 'custom_head.html' %}
{% include_optional 'custom.css' %}
</head>
<body>
{% render_header %}<!-- carga before_header.html y after_header.html en caso de que existan -->
require 'http'
require 'nokogiri'
url = "https://www.rae.es/noticia/las-palabras-del-ano-en-el-universo-hispanohablante"
content = HTTP.follow.get url
doc = Nokogiri::HTML content.to_s
rae2020 = doc.css('.bloque-texto a[target="_blank"]')
puts rae2020.select { |x| x.parent.children.count < 2}
.each {|x| x.content }.join(" / ")
### Respuesta Transbank
`vci` (String)
Puede tomar el valor
* TSY (Autenticación exitosa),
* TSN (Autenticación fallida),
* TO (Tiempo máximo excedido para autenticación),

Bootic API usando curl

El siguiente mini-tutorial muestra cómo usar la API de Bootic usando la herramienta [curl][curl].

Antes de nada es preciso crear una aplicación y generar un access token, los siguiente pasos lo ilustran:

Paso 1: Crear una aplicación

https://dafirenze.cl/collections/sale?utm_source=ccs&utm_medium=logo&utm_campaign=cyber_oct ['vestuario']
https://www.mercadolibre.cl/cyber-monday ['multitiendas']
https://www.japijane.cl/ ['salud']
https://www.todopiel.cl/ ['vestuario']
https://www.sodimac.cl/sodimac-cl/?sid=bnnext150064&disp=OTROS-MEDIOS ['hogar']
https://www.mitiendacotidian.cl/cybermonday ['salud']
http://bit.ly/2nNkaTq ['salud']
https://www.carterasecret.cl/?utm_source=cyberoct&utm_medium=referal&utm_campaign=cyber_octubre_2019&utm_content=cyber ['accesorios']
https://www.a3d.cl/?prx=ccs ['multitiendas']
https://www.eliteperfumes.cl/ ['salud']
from bs4 import BeautifulSoup
import os
import urllib.request
file = open("t.tmp")
content = file.read()
soup = BeautifulSoup(content,'html.parser')
@juque
juque / .gitignore
Last active August 5, 2019 02:52
emmet lib
.sass-cache
*css.map
@juque
juque / ejemplo.js
Last active June 26, 2019 18:02
Bootic API: Ejemplo de JSON para importar productos nuevos
[
{
"description": "Silla visita asiento y respaldo pl\u00e1stico de color. Estructura de tubo redondo acanalado negro, aluminio y cromado. Opcionalmente con brazos.\nAncho: 48 cm\nLargo: 41 cm\nAltura: 79 cm\nAltura asiento: 47 cm\nColores:\u00a0Azul / Gris / Negro / Naranja / Arena / Verde / Blanco\nMaterial: Metal y polipropileno\nApilable: S\u00ed\nC\u00f3digo Producto: ASE-004",
"name": "Silla Palmate",
"photos": [
{
"name": "Silla-Fin.jpg"
},
{
"name": "Silla-Palmate-Brazos.jpg"
@juque
juque / wget-snapshotpage.md
Created June 1, 2019 06:10 — forked from dannguyen/wget-snapshotpage.md
Use wget to snapshot a page and its necessary visual dependencies

Use wget to mirror a single page and its visible dependencies (images, styles)

Money graphic via State of Florida CFO Vendor Payment Search

Graphic via State of Florida CFO Vendor Payment Search (flair.myfloridacfo.com)

This is a quick command I use to snapshot webpages that have a fun image I want to keep for my own collection of WTFViz. Why not just right-click and save the image? Oftentimes, the webpage in which the image is embedded contains necessary context, such as captions and links to important documentation just incase you forget what exactly that fun graphic was trying to explain.

@juque
juque / function.php
Created March 12, 2019 14:23 — forked from swapnilshrikhande/function.php
Send mail with mailgun api by PHP CURL.
<?php
define('MAILGUN_URL', 'https://api.mailgun.net/v3/DOMAIN_NAME');
define('MAILGUN_KEY', 'KEY');
function sendmailbymailgun($to,$toname,$mailfromnane,$mailfrom,$subject,$html,$text,$tag,$replyto){
$array_data = array(
'from'=> $mailfromname .'<'.$mailfrom.'>',
'to'=>$toname.'<'.$to.'>',
'subject'=>$subject,
'html'=>$html,