A Pen by Victor Vergara on CodePen.
This file contains hidden or 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
<header> | |
<h1 class="fluid">you deserve<br />more.</h1> | |
</header> | |
<main> | |
<section class="content fluid"> | |
<h2><span aria-hidden="true">you can </span> | |
<span class="sr-only">you can ship things.</span> | |
</h2> | |
<ul aria-hidden="true" style="--count: 22"> | |
<li style="--i: 0">optimize.</li> |
This file contains hidden or 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 multiprocessing #:) | |
def do_this(number): | |
print number | |
return number*2 | |
# Create a list to iterate over. | |
# (Note: Multiprocessing only accepts one item at a time) | |
some_list = range(0,10) |
This file contains hidden or 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
""" | |
Usage: | |
Make sure that redis is running on localhost (or adjust the url) | |
Install uvicorn or some other asgi server https://asgi.readthedocs.io/en/latest/implementations.html | |
pip install -u uvicorn | |
Install dependencies |
This file contains hidden or 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
1WBllCh7h5NjY09cvDby-amOO2FN0HbOA |
This file contains hidden or 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
# source: https://www.geeksforgeeks.org/difference-between-multithreading-vs-multiprocessing-in-python/ | |
import time, os | |
from threading import Thread, current_thread | |
from multiprocessing import Process, current_process | |
COUNT = 200000000 | |
SLEEP = 10 | |
def io_bound(sec): |
This file contains hidden or 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 f(*, a): | |
pass | |
f(1) # raises error | |
f(a=1) # works |
This file contains hidden or 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
# ======================================================================================== | |
# setup image | |
# ======================================================================================== | |
# download or build image | |
docker build . | |
# ======================================================================================== | |
# setup container | |
# ======================================================================================== |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder