List of helpful shortcuts for faster coding
If you have any other helpful shortcuts, feel free to add in the comments of this gist :)
apiVersion: autoscaling/v2beta1 | |
kind: HorizontalPodAutoscaler | |
metadata: | |
name: airflow-worker | |
namespace: # use ${AIRFLOW_WORKER_NS} variable defined above | |
spec: | |
scaleTargetRef: | |
apiVersion: apps/v1 | |
kind: Deployment | |
name: airflow-worker |
spec: | |
template: | |
spec: | |
containers: | |
- name: airflow-worker | |
resources: | |
requests: | |
memory: 2Gi | |
limits: | |
memory: 2Gi |
The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.
You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.
def cmd(cm: str): | |
import subprocess | |
import re | |
return subprocess.run(re.compile("\s+").split(cm)) |
from abc import ABC, abstractmethod | |
class Validator(ABC): | |
def __set_name__(self, owner, name): | |
self.private_name = f'_{name}' | |
def __get__(self, obj, objtype=None): | |
return getattr(obj, self.private_name) | |
with ignored(OSError): | |
os.remove('file.txt') | |
# izip, iter(partial(f, 1), '') | |
# vars(obj) |
As a note, if you find errors with the math below, please let me know.
This cost comparison only compares cost per I/O operation. It does not discuss storage or transit costs.
defmodule MyApp.Migration do | |
@moduledoc """ | |
Additional helpers for PostgreSQL. | |
""" | |
import Ecto.Migration, only: [execute: 2] | |
defmacro __using__(_) do | |
quote do | |
use Ecto.Migration |