This file contains 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
set encoding=utf-8 | |
scriptencoding utf-8 | |
set nocompatible | |
filetype off | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'VundleVim/Vundle.vim' | |
Plugin 'vim-scripts/Align' |
This file contains 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
def inf(i=0, step=1): | |
#un generador de iteradores infinitos, como el xrange, pero infinito | |
while True: | |
yield i | |
i+=step | |
for i in inf(): | |
print i |
This file contains 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
#Lista de numeros primos entre 1 y 100 en una sola linea | |
c = [i for i in xrange(2,101) if (i%2!=0 or i==2) and (i%3!=0 or i==3) and (i%5!=0 or i==5) and (i%7!=0 or i==7)] | |
print c |
This file contains 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 random | |
def quicksort_iterativo(lista: [int]) -> [int]: | |
''' Una implementación del mismo algoritmo que conoces y amas, pero sin | |
utilizar recursión, solo bucles y una pila ''' | |
ordenada = lista[:] | |
pila = [(0, len(lista) - 1)] |
This file contains 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
Diagrama Xalapa | |
44.4,46.7,41.4,65.9,110.8,278,206.1,164.9,255,89.4,58.7,50 | |
15.7,16.6,18.8,21.1,22,21.7,20.7,20.8,20.4,19.3,17.8,16.4 | |
Diagrama Perote | |
13.3,14.2,11.1,26.2,34.8,74.9,53.3,54.6,110.8,76,24.8,13.8 | |
9.9,10.9,13.3,14.9,15.4,14.7,13.6,13.4,13.4,12,10.7,12.7 | |
Diagrama Paso de ovejas | |
14.8,10.2,8.6,10.6,32.3,172.6,239,180.5,161.3,61.2,27.8,14.7 | |
21.4,22.2,24.3,26.7,28.2,28.1,26.7,26.9,26.9,25.8,24.2,22.1 | |
Diagrama las Vigas |
This file contains 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 json | |
import requests | |
import pandas | |
from pandas.io.json import json_normalize | |
import geopandas as gpd | |
import matplotlib.pyplot as plt | |
url = "https://smn.conagua.gob.mx/tools/PHP/sivea/siveaEsri2/php/temp_genjson.php?per=T3" | |
resp = requests.get(url) | |
data = resp.json() |
This file contains 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
# validate github signature | |
import hashlib | |
import hmac | |
import json | |
signature = hmac.new(GITHUB_TOKEN, payload, hashlib.sha1).hexdigest() | |
# assuming that the 'payload' variable keeps the content sent by github as plain text | |
# and 'headers' variable keeps the headers sent by GitHub |
This file contains 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
print(u'\xa1'+[{'foo': i, 'var': ['pez', 'rana', lambda a: (str(a), u'678hHola mundo!nguy')]} for i in ['a' in 'pan']][not True]['var'][2](1)[1][4:15]) #Jaque mate |
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf8" /> | |
<style> | |
:root { | |
--thing-color: blue; | |
} | |
#cosa { |
This file contains 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 hashlib | |
h = hashlib.new('md5') | |
h.update(b"39") | |
new = (h.hexdigest() + '+47').encode() | |
h = hashlib.new('md5') | |
h.update(new) |
NewerOlder