Key | Result |
---|---|
v |
select |
y |
copy (yank) |
c |
change |
d |
delete |
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
#!/usr/bin/env bash | |
# Abort sign off on any error | |
set -e | |
# Start the benchmark timer | |
SECONDS=0 | |
# Repository introspection | |
OWNER=$(gh repo view --json owner --jq .owner.login) |
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
# THIS LINUX SETUP SCRIPT HAS MORPHED INTO A WHOLE PROJECT: HTTPS://OMAKUB.ORG | |
# PLEASE CHECKOUT THAT PROJECT INSTEAD OF THIS OUTDATED SETUP SCRIPT. | |
# | |
# | |
# Libraries and infrastructure | |
sudo apt update -y | |
sudo apt install -y \ | |
docker.io docker-buildx \ | |
build-essential pkg-config autoconf bison rustc cargo clang \ |
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 duckdb | |
from google.cloud import bigquery | |
bqclient = bigquery.Client() | |
table = bigquery.TableReference.from_string( | |
"bigquery-public-data.utility_us.country_code_iso" | |
) | |
rows = bqclient.list_rows(table) | |
country_code_iso = rows.to_arrow(create_bqstorage_client=True) | |
cursor = duckdb.connect() |
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
# Instructions | |
# 1. Write down Python code in say() method | |
# - This method might have one parameter `number` which possibly 1-99 | |
# - This method need to return an English word for provided number e.g. If the number is 3, should return "three" | |
# 2. More examples on test data (numbers and words) are in the "Test Data Example" section | |
# 3. How to run this file through unit tests | |
# - Open the terminal | |
# - Run this command "python <path/to/file.py>" e.g. python PyConUS2021Challenge.py | |
# - If the tests are failed, it will display "FAILED (failures=16)" for example, on the terminal | |
# - If the tests are pass, it will display "Ran 16 tests in 0.001s OK" |
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 random | |
from airflow.operators.dummy_operator import DummyOperator | |
from airflow.models import DAG | |
from airflow.utils.dates import days_ago | |
with DAG( | |
"big_dag", | |
start_date=days_ago(1), | |
schedule_interval=None, |
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 uuid | |
from django.db import models | |
from django.contrib.auth import get_user_model | |
class Badge(models.Model): | |
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) | |
label = models.CharField(max_length=255) | |
description = models.TextField() |
This is a Cheat Sheet for interacting with the Mongo Shell ( mongo on your command line). This is for MongoDB Community Edition.
Mongo Manual can help you with getting started using the Shell.
FAQ for MongoDB Fundamentals and other FAQs can be found in the side-bar after visiting that link.
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
# ---- Base python ---- | |
FROM python:3.6 AS base | |
# Create app directory | |
WORKDIR /app | |
# ---- Dependencies ---- | |
FROM base AS dependencies | |
COPY gunicorn_app/requirements.txt ./ | |
# install app dependencies | |
RUN pip install -r requirements.txt |
Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups
command.
- List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe
Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.
- Reset the consumer offset for a topic (preview)
NewerOlder