Skip to content

Instantly share code, notes, and snippets.

View gsampallo's full-sized avatar

Guillermo Sampallo gsampallo

View GitHub Profile
@gsampallo
gsampallo / dockerfile
Created May 7, 2022 15:06
dockerfile Python
FROM python:latest
LABEL Maintainer="gsampallo"
WORKDIR /usr/app/src
COPY *.py ./
COPY requirements.txt ./
COPY test.jpg ./
RUN pip install --no-cache-dir -r requirements.txt
@gsampallo
gsampallo / asciiart.py
Last active May 7, 2022 14:33
Asciiart
# Code from https://dev.to/stokry/create-ascii-art-with-python-31nd
import sys
from PIL import Image
from termcolor import colored
import colorama
colorama.init()
image_path = 'test.jpg'
class AsciiArt:
@gsampallo
gsampallo / compras.md
Last active March 22, 2021 13:39
Compras readme

Compras con Docker

Sistema de compras montado sobre docker Guillermo Sampallo @gsampallo

Instalación

  1. Instalar docker, elegir el instalador según la plataforma. Tutorial paso a paso para instalar docker en Ubuntu.
  2. Descomprimir el archivo adjunto en una carpeta, por ejemplo /compras. Se van a crear tres carpetas:
    • app: es la carpeta donde se encuentran los php de la aplicacion.
@gsampallo
gsampallo / charlieplexing.ino
Created November 11, 2020 19:12
Demostración de Charlieplexing con 3 pines y 6 leds.
/*
* Ejemplo de Charlieplexing con 3 pines y 6 leds.
* Guillermo Sampallo - 2020
*/
void setup() {
}
void loop() {
pinMode(2,OUTPUT);
@gsampallo
gsampallo / appinventor_dht11.ino
Created October 24, 2020 02:08
DPRE - APP Inventor - Control temperatura
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include "DHT.h"
#define DHTPIN 4
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
@gsampallo
gsampallo / appinventor_control_led.ino
Last active October 24, 2020 01:12
DPRE - APP Inventor - Control de Leds
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
const char* ssid = "NOMBRE_RED";
const char* password = "CLAVE";
ESP8266WebServer servidor(80);
int pinLed1 = 5; //D1
@gsampallo
gsampallo / demo_thingspeak.ino
Created October 17, 2020 13:42
DPRE - Enviar datos analogicos a ThingSpeak
#include <ESP8266WiFi.h>
#include "ThingSpeak.h"
const char* ssid = "X";
const char* password = "X";
WiFiClient client;
unsigned long numeroCanal = X;
@gsampallo
gsampallo / Blynk_lm35.ino
Created October 16, 2020 20:13
DPRE - Blynk - Envio de datos del sensor de temperatura LM35
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = "COPIE_AUTH_KEY_AQUI";
char ssid[] = "RED_WIFI";
char pass[] = "CLAVE";
@gsampallo
gsampallo / ThingSpeak_lm35.ino
Created October 14, 2020 12:40
DPRE 2020 - Plataformas IoT - Enviar datos a ThingSpeak
/*
* El siguiente programa publica la temperatura en la plataforma ThingSpeak cada 20 segundos.
*/
#include <ESP8266WiFi.h>
#include "ThingSpeak.h"
const char* ssid = "NOMBRE_RED";
const char* password = "PASSWORD_RED";
WiFiClient client;
@gsampallo
gsampallo / digital_pot.ino
Created September 13, 2020 21:51
How to use a digital potenciometer with Arduino (MCP 4131-103)
/*
* How to use a digital potenciometer with Arduino
* Link to article: https://www.gsampallo.com/?p=952
*/
#include <SPI.h>
byte address = 0x00;
int CS = 10;
void setup() {