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 python3 | |
''' | |
Inspired by pytest fixtures :) | |
''' | |
import argparse | |
from inspect import signature | |
import logging | |
from reprlib import repr as smart_repr |
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
export default class PageLayout extends React.Component { | |
render() { | |
const { | |
children, siteTitleH1, mobileView, userAgent, | |
currentLanguage, enVersionUrl, csVersionUrl, | |
} = this.props; | |
let appBar = null; |
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 flask | |
app = flask.Flask(__name__) | |
@app.route('/') | |
def index(): | |
return 'ahoj <img src="/graf">' | |
@app.route('/graf') | |
def graf(): |
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
either = lambda a, b: lambda i: a(i) or b(i) | |
plus = lambda a, b: lambda i: a(i) + b(i) | |
div = lambda n: lambda i: i % n == 0 | |
iff = lambda c, a, b: lambda i: a(i) if c(i) else b(i) | |
nothing = lambda x: '' | |
itself = lambda x: x | |
const = lambda x: lambda i: x | |
# some hints how it works :) |
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 HackerRank.com | |
""" Node is defined as | |
class node: | |
def __init__(self, data): | |
self.data = data | |
self.left = None | |
self.right = None | |
""" | |
def check_binary_search_tree_(root, lower_bound=None, upper_bound=None): | |
if not root: |
Loading
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
#!/usr/bin/env python3 | |
ciphertext = ''' | |
ymjwj fwj ybt ydujx tk jshwduynts: tsj ymfy bnqq | |
uwjajsy dtzw xnxyjw kwtr wjfinsl dtzw infwd fsi tsj ymfy bnqq | |
uwjajsy dtzw ltajwsrjsy. ymnx nx f ajwd nrutwyfsy qjxxts yt | |
wjrjgjwjxujhnfqqd ktw fyyfhpx zxnsl kwjvzjshd fsfqdxnx bmnhm | |
wjvznwj qtsljw ufxxflj tk yjcy ns twijw yt fhmnjaj gjyyjw wjxzqyx. | |
''' |
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 debian:stretch | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-get update | |
RUN apt-get install -y apt-utils wget bzip2 | |
WORKDIR /src |
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
venv_dir=local/venv | |
pyvenv=pyvenv-3.5 | |
default: check | |
check: $(venv_dir)/packages-installed | |
$(venv_dir)/bin/py.test tests | |
run: $(venv_dir)/packages-installed | |
$(venv_dir)/bin/my-awesome-app |
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 python3 | |
from bson import MinKey | |
import pymongo | |
from pymongo import ASCENDING | |
client = pymongo.MongoClient() | |
db = client['test'] | |
collection = db['dataset'] |