I hereby claim:
- I am amitnabarro on github.
- I am amitn (https://keybase.io/amitn) on keybase.
- I have a public key whose fingerprint is F6DF 45A4 5B6D CAC3 D9B6 435E F7A4 F909 EE1A 341A
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
from sanic import Sanic | |
from sanic.response import json | |
app = Sanic() | |
@app.route("/") | |
async def test(request): | |
return json({"hello": "world"}) | |
if __name__ == "__main__": |
import asyncio | |
async def greet(name): | |
print('hello ' + name) | |
try: | |
loop = asyncio.get_event_loop() | |
loop.run_until_complete(greet('world !')) | |
finally: | |
loop.close() |
import asyncio | |
import time | |
async def wait_for_stuff(): | |
start = time.time() | |
for i in range(0, 5): | |
await asyncio.sleep(1) | |
print('Time elapsed: %d seconds' % int(time.time() - start)) | |
try: |
import asyncio | |
import time | |
async def wait_for_stuff(): | |
start = time.time() | |
futures = [] | |
for i in range(0, 5): | |
futures.append(asyncio.sleep(1)) | |
await asyncio.wait(futures) |
it('returns an object containing all users', done => { | |
const server = sinon.fakeServer.create() | |
server.respondWith('GET', '/users', [ | |
200, | |
{ 'Content-Type': 'application/json' }, | |
'[{ "id": 1, "name": "Brian" }, { "id": 2, "name": "Ron" }]' | |
]) | |
Users.all() | |
.done(collection => { | |
const expectedCollection = [ |
import asyncio | |
import aiohttp | |
import json | |
import itertools | |
SEARCH_URL = 'https://jobs.github.com/positions.json?' | |
async def fetch_job_opportunities(session, url): |
import asyncio | |
import aiohttp | |
import time | |
running = True | |
async def check_status_periodically(): | |
async with aiohttp.ClientSession() as session: | |
while running: |