Skip to content

Instantly share code, notes, and snippets.

View erickdsama's full-sized avatar
🕳️

Erick Samaniego erickdsama

🕳️
View GitHub Profile
#!/usr/bin/python
# Import the required modules
import cv2, os
import numpy as np
from PIL import Image
import time
# For face detection we will use the Haar Cascade provided by OpenCV.
cascadePath = "haarcascade_frontalface_default.xml"
faceCascade = cv2.CascadeClassifier(cascadePath)
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>ViveBus</name>
<Style id="icon-1899-DB4436-nodesc-normal">
<IconStyle>
<color>ff3644db</color>
<scale>1</scale>
<Icon>
<href>http://www.gstatic.com/mapspro/images/stock/503-wht-blank_maps.png</href>
@erickdsama
erickdsama / CustomModel.py
Created January 31, 2018 19:41
Model JSONField
import json
from django import forms
from django.db import models
class JsonField(models.TextField):
# object ready to python
def to_python(self, value):
import cv2
from pylibdmtx.pylibdmtx import decode
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
import imutils
cap = cv2.VideoCapture(0)
id = 1
def filtros_imagen(img):
@erickdsama
erickdsama / rwas.py
Last active March 4, 2024 19:21
Class to read and write messages to Whatsapp through of the ADB. You need a android Device with Sqlite3 installed and ADB service.
# coding=utf-8
import json
import time
from subprocess import check_output, CalledProcessError
class WHO:
FROM_ME = "key_from_me == 1"
OTHERS = "key_from_me != 1"
ALL = ""
with open('Downloads/problem_1_data.txt', 'r') as content_file:
import re
content = content_file.read()
data = []
init = 0
while True:
person = {}
person["name"] = content[init:init+10].strip()
person["middlename"] = content[init+10:init+20].strip()
init_street = init+50
@erickdsama
erickdsama / variables_python.py
Last active July 12, 2019 23:56
Tipos de variables en python y como asignar
# variable de tipo texto
a = "texto"
# variable de tipo entero
b = 1
# variable de tipo doble
c = 1.0
# varibale de tipo boleano
@erickdsama
erickdsama / hello_world.py
Created July 13, 2019 00:22
Como utilizar todas los tipos de variables en python
mensaje = "hola mundo"
iteraciones = 10
mensajes = []
pares = True
for iteracion in range(iteraciones):
par = iteracion % 2 == 0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
[
{
"height": 0.7,
"weight": 6.9,
"attack": 49,
"hp": 45,
"defense": 49,
"speed": 45,
"speedAttack": 65,
"speedDefense": 65,