| import * as z from "zod"; | |
| export type FormFieldType = "text" | "textarea" | "email" | "tel" | "number" | "select" | "multiselect" | "array" | "date"; | |
| export interface FormField { | |
| name: string; | |
| label: string; | |
| type: FormFieldType; | |
| required?: boolean; |
Python is one of the tools in my toolbox, so I never used it exclusively. This means i need to get an update, occasionally.
Rant mode on
They want to have an expressive language, so they keep adding features upon features to it, instead of caring too much about performance (which means that no JIT - just-in-time compiler - has been added to cpython).
I would have thought that typescript is gaining over python on github, because node.js is JIT based, unlike cpython, but that guess was wrong: github article. The github article suggests a different reason:
/More Eitzes from me, 'Eitzes is billik' - advice comes cheap.../
This gist is my experience. In general: do not trust such advice. Somehow the market tends to change every few years, always be aware of that possibility and be on the look-out.
You can work for a big established company or for a startup. With more advanced companies you have a less stressed environment / and a more steady job, kind of.
| type ServiceA = Service<"ServiceA"> & { | |
| name: "ServiceA"; | |
| foo: () => void; | |
| }; | |
| type ServiceB = Service<"ServiceB"> & { | |
| name: "ServiceB"; | |
| bar: () => void; | |
| }; | |
| type Service<T extends string> = { | |
| __brand: T; |
Hello software developers,
Please check your code to ensure you're not making one of the following mistakes related to cryptography.
- Writing your own home-grown cryptography primitives (For example: Mifare Classic)
- Exception: For the sake of learning, but don't deploy it in production.
- Using a fast hash function (e.g. MD5, SHA256) for storing passwords. Use bcrypt instead.
- Not using a cryptographically secure random number generator
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
| from alembic import config | |
| from alembic import script | |
| from alembic.runtime import migration | |
| import sqlalchemy | |
| import exceptions | |
| engine = sqlalchemy.create_engine(DATABASE_URL) | |
| alembic_cfg = config.Config('alembic.ini') |
This document is a reference for common testing patterns in a Django/Python project using Pytest.
Contents: