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
<div class="container center"> | |
<div class="row"> | |
<div class="col s12 l8 offset-l2"> | |
<h1>Sugerencias</h1> | |
<p> | |
Escríbenos las sugerencias o recomendaciones que tengas: | |
</p> | |
<div class="input-field col s12"> | |
<textarea id="sugerencia" class="materialize-textarea"></textarea> |
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
## File: www/index.html | |
var app = angular.module('app', ['ionic', 'restmod']) | |
## File: www/modelos/Supermercado.js | |
app.factory('Supermercado', function(restmod) { | |
return restmod.model('http://localhost:3000/api/v1/supermercados') | |
}) | |
## File: www/controladores/supermercados.js | |
app.controller('ListaMercados', function($scope, Supermercado) { |
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
No API style base was selected, see the Api Integration FAQ for more information on this warning | |
mercados.js:3 Supermercados: | |
(index):1 XMLHttpRequest cannot load http://localhost:3000/api/v1/supermercados. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8100' is therefore not allowed access. |
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
before_filter :establecer_cabeceras_cors | |
def establecer_cabeceras_cors | |
headers['Access-Control-Allow-Origin'] = 'http://127.0.0.1:8100' | |
headers['Access-Control-Allow-Methods'] = 'GET,POST,PUT,DELETE' | |
headers['Access-Control-Allow-Headers'] = '*' | |
headers['Access-Control-Max-Age'] = '3628800' | |
end |
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
import smtplib | |
# Creamos la conexión con el servidor | |
sesion_smtp = smtplib.SMTP('smtp.gmail.com', 587) | |
# Ciframos la conexión | |
sesion_smtp.starttls() | |
# Iniciamos sesión en el servidor | |
sesion_smtp.login('[email protected]','una contraseña segura') |
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
import smtplib | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
# Iniciamos los parámetros del script | |
remitente = '[email protected]' | |
destinatario = '[email protected]' | |
# Creamos el objeto mensaje | |
mensaje = MIMEMultipart() |
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
import smtplib | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
from email.mime.base import MIMEBase | |
from email import encoders | |
# Iniciamos los parámetros del script | |
remitente = '[email protected]' | |
destinatarios = ['[email protected]', '[email protected]', '[email protected]'] | |
asunto = '[RPI] Correo de prueba' |
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
import RPi.GPIO as GPIO | |
import time | |
# Establecemos el modo de referenciar los puertos | |
# Broadcom SOC channel | |
GPIO.setmode(GPIO.BCM) | |
# Desactivamos los mensajes de advertencias | |
GPIO.setwarnings(False) | |
# Configuramos el puerto para el led |
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
import RPi.GPIO as GPIO | |
import time | |
# Establecemos el modo de referenciar los puertos | |
# Broadcom SOC channel | |
GPIO.setmode(GPIO.BCM) | |
# Desactivamos los mensajes de advertencias | |
GPIO.setwarnings(False) | |
# Configuramos el puerto para el led |
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
import RPi.GPIO as io | |
import time | |
# Establecemos el modo de referenciar los puertos | |
# Broadcom SOC channel | |
io.setmode(io.BCM) | |
# Desactivamos los mensajes de advertencias | |
io.setwarnings(False) | |
# Configuramos el puerto para el led |
OlderNewer