Skip to content

Instantly share code, notes, and snippets.

View mevangelista-alvarado's full-sized avatar
💭
Working and learning at @Prescrypto and UNAM

M mevangelista-alvarado

💭
Working and learning at @Prescrypto and UNAM
View GitHub Profile
@mevangelista-alvarado
mevangelista-alvarado / cut_string.py
Created June 28, 2018 21:38
This a test for cut a phrase with a limit, without cutting words
# Variables
test = u'Hola a todo el mundo' # Enter a phrase
lenght = 10 # Enter a number
test_list = test.split()
i = len(test_list)
while i<=len(test_list):
phrase = " ".join(list[0:i])
if len(phrase)<lenght:
@mevangelista-alvarado
mevangelista-alvarado / test_rsa.py
Created July 3, 2018 17:24
Test of the rsa library from python and compatible with the signature of jsrsasing library from javascript
import rsa
import base64
import binascii
def load_puk(name_file):
name_file = name_file + '.pem'
with open(name_file, 'rb') as file:
PublicKey = file.read()
puk = rsa.PublicKey.load_pkcs1_openssl_pem(PublicKey)
return puk
@mevangelista-alvarado
mevangelista-alvarado / virtualenv.md
Last active July 13, 2018 21:31
Small description for use virtual environment for OS X and Linux

Virtual Environment

Create

To start, first create a directory

    mkdir directory_name
@mevangelista-alvarado
mevangelista-alvarado / is_symplectic.py
Created November 27, 2018 22:16
This file is a method for know if a differentiable form is symplectic.
import sys
import ga
import sympy
#import ast
class PoissonGeometry(object):
def __init__(self, *args, **kwargs):
'''Inicialize global variables'''
from Crypto.PublicKey import RSA # nosec B413
from Crypto.Hash import SHA256 # nosec B413
# Read FIEL.cer
def read_fiel_cer(directory_file):
try:
public_key = None
with open(directory_file + '.cer', 'rb') as f:
public_key = RSA.import_key(f.read())
except Exception as e:
@mevangelista-alvarado
mevangelista-alvarado / totalmedic_example.json
Created January 23, 2020 22:34
Un ejemplo de como se guardará la data de total medic en Products
{
"_id" : ObjectId("5c59de20791330c1e7ad15d5"),
"package_desc" : "Muñequera Sencilla de Neopreno",
"brand" : "TOTAL MEDIC",
"upc" : "7503024808988",
"image_url" : "https://s3-us-west-2.amazonaws.com/drugs-catalog/all_drugs/7503024808988.png",
"provider" : "total_medic",
"categories" : "['muñequera']",
"flag dbase" : "Total Medic",
"unique_id" : "64d2d603e682c0b4d63f4c9a242852b66df33da05d9654000aef8dc56ded3403",
This file has been truncated, but you can view the full file.
{
"2d2d2d2d2d424547494e205055424c4943204b45592d2d2d2d2d0a4d4949426c44414e42676b71686b6947397730424151454641414f43415945414d49494266414b4341584d416b42467256782f435a6f774852766231646252760a716735762b612f2f36304678372f354f7061547035553758616b31504e4732714c554b416a2f5253447961415a5033725258302f5567414e7a66544761444c6e0a56595568497a424879412b4954396c4666633138316a614a71564e4d5635613735354f306f5265596e3754454c32542b66774b4b4f567056576f7476576969540a5250364745714434706e72645435566533535a6748744c442b633045302b6d78382b6178505458574b342b6359746e73354e714a58356962704b4542727779410a38704675596941674f7a7a63364847724c694e7846396d4d694539527362624c743471434e4b744a6f716b6f46413868596233664f793774682b6b754c774a770a7655556d587a694b5a59707136786e6363424c336a5133355734747a574c464e525376654d315542676f6448687a7679766c53354a58345558356f73426358750a6536672f3130594c70783873492f732b6b544a69507a3848644c6b733946476a6f6c437655376a5470667263714f6935727036426f7031646b5556646e7441320a614e38486f3667494b6157315766766d33443246584a523570434b4
[
{
"2d2d2d2d2d424547494e205055424c4943204b45592d2d2d2d2d0a4d4949423254414e42676b71686b6947397730424151454641414f43416359414d49494277514b434162686d77566e32696c47375a74547454732b4c696d69640a527237745872466a5772646c555945477a74307254627a726648417a366265744a7a4a6e45563744622b63353074706a304f5762793936326d743647423568420a696d4344674f50514b4934386f2f395950542f56654b49486144672f786d6f2f51355a744b7a446133712f6665756d764433637a4950664e6b4d757549734e6d0a79324c7456686b76387969494377414c6467506a4777487a42496c5951356d337748782b694171676469436665782b5038354c6564436f634a3566782b6768590a53633050554e4e385a4b34577934754a4c582f38714e4a336d38336446486445792b53686f54692b67716b59754936303347446d78336632486f38645330792b0a6359724e74564763537958424f306a55547173736242446e777a4f73306c4c59664a6635637174444e364e4e6d3831377578316d384e42635777534248666a750a5932346c4374357768537869504962317657476f7a6d43705a304233526d687541516777464d634a416f4641627145386d74784262507a533048732b587941660a544a52777152717a4858326b4c7158744c41365732616b595
@mevangelista-alvarado
mevangelista-alvarado / resize1920.py
Created July 29, 2020 15:23 — forked from xtornasol512/resize1920.py
Wand, Python, resize 1920 and quality 92 or more
# -*- coding: utf-8 -*-
"""
Author: Jesus A. Garzon
github: xtornasol512
twitter: xtornasol512
Description:
Just put this script in your directory of images
After create a directory for img_result
Then execute the script
python resize1920.py
Puebla Valle Morelia Cuernavaca
72227 51246 58096 62507
72230 51200 58314 62493
72474 51226 58331 62115
72595 51220 58180 62076
72260 51239 58189 62159
72498 51230 58337 62300
72490 51225 58357 62130
72110 51217 58190 62294
72494 51206 58060 62010