See how a minor change to your commit message style can make a difference.
Tip
Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs
# THE SOLUTION IS THE FUNCTION `generate_first_elements` | |
# write a function which takes an iterable of iterators as | |
# an argument and returns a generator of first elements of | |
# the input iterators | |
def generate_first_elements(iterable_arg): | |
# return a "generator object" that produces the first |
See how a minor change to your commit message style can make a difference.
Tip
Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs
#!/usr/bin/env bash | |
LATEST_DB="$HOME/Downloads/$(ls -t ~/Downloads | head -1)" | |
BACKUP_PATH=${2-$LATEST_DB} | |
DB=$1 | |
echo "Creating database name $DB from $BACKUP_PATH" | |
psql -c "CREATE DATABASE $DB;" |
FROM python:3 as build-system | |
RUN pip install -U pip | |
COPY requirements.txt requirements.txt | |
### create temporary image used to download and vendor packages using private key ### | |
FROM build-system as intermediate | |
# add credentials on build |
To send a request via the sandbox, you can use pm.sendRequest.
pm.test("Status code is 200", function () {
pm.sendRequest('https://postman-echo.com/get', function (err, res) {
pm.expect(err).to.not.be.ok;
pm.expect(res).to.have.property('code', 200);
pm.expect(res).to.have.property('status', 'OK');
});
});
########### | |
# Python 2: | |
########### | |
try: | |
raise Exception | |
except Exception as e: | |
s,r = getattr(e, 'message') or str(e), getattr(e, 'message') or repr(e) | |
print 's:', s, 'len(s):', len(s) | |
print 'r:', r, 'len(r):', len(r) | |
Short (72 chars or less) summary
More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).
Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
import aiohttp | |
import asyncio | |
BATCH_SIZE = 20 | |
POOL_SIZE = 5 | |
async def get_content(client, url): | |
async with client.get(url) as response: | |
return await response.text() |
# | |
# Avoid the message 'External file changes sync may be slow: The current inotify(7) watch limit is too low.' from JetBrains products. | |
# | |
# 1. Create the file /etc/sysctl.d/60-jetbrains.conf and paste this code | |
# 2. Restart the sysctl service: sudo sysctl -p --system | |
# 3. Restart the IDE | |
# | |
# More info: | |
# https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit |
from flask import Flask, current_app, render_template_string | |
from flask_sqlalchemy import SQLAlchemy | |
app = Flask(__name__) | |
db = SQLAlchemy(app) | |
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' | |
class Example(db.Model): | |
id = db.Column(db.Integer, primary_key=True) |