Skip to content

Instantly share code, notes, and snippets.

View Kiollpt's full-sized avatar

Kiollpt

View GitHub Profile
@Kiollpt
Kiollpt / Indexs.md
Last active September 23, 2020 02:36
#Mysql

Indexs:

Secondary Index: not prmiary key Unique Index: the performace is almost same compared to (Secondary) index

@Kiollpt
Kiollpt / 1.py
Last active September 18, 2020 09:57
from aiohttp import gather, create_task
from string import Template
from aiohttp import web, ClientSession
from bs4 import BeautifulSoup
async def news(request):
sites = [
('http://edition.cnn.com',cnn_articles),
('http://www.aljazeera.com',aljazeera_articles)
]
@Kiollpt
Kiollpt / main.py
Last active September 12, 2020 05:20
main
if __name__ == "__main__":
@Kiollpt
Kiollpt / Outline.md
Created September 8, 2020 14:05
#DDI

ch1

thinking about the data system

@Kiollpt
Kiollpt / quene.py
Last active September 6, 2020 02:07
quene #asyncio
import asyncio
import itertools as it
import os
import random
import time
async def makeitem(size: int = 5) -> str:
return os.urandom(size).hex()
async def randsleep(a: int = 1, b: int = 5, caller=None) -> None:
@Kiollpt
Kiollpt / sleep.py
Last active September 2, 2020 09:21
async sleep #asyncio
from threading import Thread
from threading import current_thread
from asyncio import Future
import asyncio
import time
c = (
"\033[0m", # End of color
"\033[36m", # Cyan
"\033[91m", # Red
@Kiollpt
Kiollpt / color print.py
Last active August 30, 2020 15:14
color print
c = (
"\033[0m", # End of color
"\033[36m", # Cyan
"\033[91m", # Red
"\033[32m", # Green
)
@Kiollpt
Kiollpt / test.py
Last active August 30, 2020 15:06
test.py
print('I am hungry Friday and Saturday is beautiful day')
[uwsgi]
module = application:app
master = true
processes = 3
chdir = YOUR_PROJECT_PATH
socket = YOUR_SOCK_FILE_PATH
chmod-socket = 777
vacuum = true