Dockerfile
FROM davidjfelix/python3.5
RUN pip3 install aiohttp
RUN pip3 install aiomysql
ADD . /seo_server
WORKDIR /seo_server
CMD python seo_server.py
sudo mysqld_safe --user=mysql --skip-grant-tables
#mysql without auth
CREATE DATABASE mydatabase CHARACTER SET utf8 COLLATE utf8_general_ci;
show processlist;
show create table <name>;
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
ab -c 20 -n 2000 http://127.0.0.1:8080/ | |
ab -c 20 -n 2000 -C 'AIOHTTP_SESSION="{\"session\": {\"user_id\": [17]}\054 \"created\": 1475102992}"' http://127.0.0.1:8080/ |
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
*Partial в javascript | |
function f(param1,param2) | |
{ | |
} | |
bf = f.bind(this,param1,param2); | |
bf() |
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
async def insert_one(pool, sql, params): | |
async with pool.acquire() as conn: | |
async with conn.cursor() as cur: | |
try: | |
await cur.execute(sql, params) | |
value = await cur.fetchone() | |
except Exception as e: | |
await conn.rollback() |
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
-- see video for description: https://www.youtube.com/watch?v=4mrBrJw_tVc&feature=youtu.be | |
-- (Nodes must be uniq) | |
import Data.Set | |
import Data.List.Split (chunksOf) | |
data Btree a = Leaf a | Node a (Btree a) (Btree a) deriving Show | |
tr :: Btree Integer | |
tr_l = Node 1 (Leaf 2) (Leaf 3) | |
tr_r = Node 4 (Leaf 5) (Leaf 6) | |
tr = Node 7 tr_l tr_r |
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
-- see video https://youtu.be/sv9y04GHvmY | |
data Btree a = Leaf a | Node a (Btree a) (Btree a) deriving Show | |
tr :: Btree Integer | |
tr_l = Node 1 (Leaf 2) (Leaf 3) | |
tr_r = Node 4 (Leaf 5) (Leaf 6) | |
tr = Node 7 tr_l tr_r | |
pre_order :: Btree a -> [a] |
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
-- see video https://www.youtube.com/watch?v=j8r17UrWSyE&t=319s | |
data Btree a = Leaf a | Node a (Btree a) (Btree a) deriving Show | |
tr :: Btree Integer | |
tr_l = Node 1 (Leaf 2) (Leaf 3) | |
tr_r = Node 4 (Leaf 5) (Leaf 6) | |
tr = Node 7 tr_l tr_r | |
all_paths :: Btree a -> [[a]] | |
all_paths (Leaf a) = [[a]] |
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
-- see video https://youtu.be/M4_OW2_zXQo | |
import Network.HTTP.Conduit | |
import Text.JSON.JPath | |
import Data.ByteString.Lazy.Char8 (unpack) | |
import Control.Concurrent | |
import Control.Exception | |
import Control.Applicative | |
import Control.Monad.Loops | |
u = "https://api.bittrex.com/api/v1.1/public/getticker?market=USD-BTC" |
OlderNewer