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
#!/usr/bin/env python | |
""" | |
Usage: | |
./rtail.py user@host:path/foo.log bar.log host2:/path/baz.log | |
""" | |
import optparse | |
import os |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from datetime import date, datetime, timedelta | |
def main(): | |
events = [ | |
ZakladniInterval(dt('2020-01-01'), dt('2030-01-01')), | |
Prodlouzeni(id=222, roky=3), | |
Zruseni(id=333, zrusit_id=222), | |
Zruseni(id=444, zrusit_id=333), | |
Zruseni(id=555, zrusit_id=444), |
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
#include <cstdio> | |
#include <cstdint> | |
int main() { | |
int size = 10; | |
void *ptr = (void*) 1000; | |
unsigned *ptr2 = (unsigned*) ptr + size; | |
printf("ptr: %lu ptr2: %lu \n", (uintptr_t) ptr, (uintptr_t) ptr2); | |
return 0; | |
} |
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
from aiohttp import ClientSession | |
from asyncio import run, gather, create_task | |
url_template = 'https://jsonplaceholder.typicode.com/posts/{post_id}' | |
worker_count = 10 | |
async def main(): | |
post_ids = list(range(1, 101)) | |
titles = {} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 ruzne_ctverce(): | |
for delka_strany in 2, 5, 7: | |
ctverec(delka_strany, symbol='O') | |
def ctverec(n, symbol='X'): | |
for cislo_radku in range(n): | |
for cislo_sloupce in range(n): | |
if ( |
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
from aiohttp import web | |
from aiohttp_graphql import GraphQLView | |
from graphql.execution.executors.asyncio import AsyncioExecutor | |
from graphql import ( | |
graphql, | |
GraphQLSchema, | |
GraphQLObjectType, | |
GraphQLField, | |
GraphQLNonNull, | |
GraphQLString, |
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 asyncio | |
from contextlib import contextmanager, asynccontextmanager, AsyncExitStack | |
@contextmanager | |
def stuff(name): | |
print('Opening', name) | |
yield | |
print(f'Closing {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
https://docs.google.com/presentation/d/1YUT0WPmqJt1tn4MaqWqVctzslT4wuCNHiaok0Ii665o/edit?usp=sharing |