For anyone considering the use of ULIDs in MySQL with drizzle
, here's a ready-to-use ULID
type for your convenience.
import { Ulid as ULID } from "id128";
export const ulid = customType<{
data: string;
notNull: true;
default: false;
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- Shaka Player compiled library: --> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/shaka-player/4.3.3/shaka-player.compiled.debug.min.js" | |
integrity="sha512-wTnBx6lDjouPRTLQUxGz9Djs/+d5m2XsIbCyxZe7H2mVCImlKjx+PcuLisTDPQD5uSq+eNrdOtZtu08zrkHLMA==" | |
crossorigin="anonymous" referrerpolicy="no-referrer"></script> | |
</head> | |
<body> |
For anyone considering the use of ULIDs in MySQL with drizzle
, here's a ready-to-use ULID
type for your convenience.
import { Ulid as ULID } from "id128";
export const ulid = customType<{
data: string;
notNull: true;
default: false;
Adaptive Streaming has become the neccessity for streaming video and audio. Unfortantely, as of this post, there isn't a whole lot of tutorials that accumulate all of the steps to get this working. Hopefully this post achieves that. This post focuses on using Amazon Web Services (AWS) to transcode for HLS and DASH and be the Content Delivery Network (CDN) that delivers the stream to your web page. We'll be using Video.js for the HTML5 player as well as javascript support libaries to make Video.js work with HLS and DASH.
Over the weekend I spun up a new Elixir :ecto, "2.2.7" project that I was able to get working with CockroachDB and this adapter fork - with some caveats I wanted to share to help others.
Only the root
user can create databases
This requires you configure the Ecto.Adapters.Postgres
username
as root
or else the mix ecto.create
command will always fail. You can go back and change your configured username
to something else after the database has been created, or create your database and user permissions using cockroach sql
and skip the mix ecto.create
command.
Configuring Ecto primary_key ID to be created by CockroachDB
By default when configuring your Ecto.Schema
using autogenerate: false
it appears either CockroachDB, Ecto or the Postrex adapter (I did not investigate this) uses the BIGINT
unique_rowid()
function as the default value for IDs
@primary_key {:id, :id, autogenerate:
I wrote this answer on stackexchange, here: https://stackoverflow.com/posts/12597919/
It was wrongly deleted for containing "proprietary information" years later. I think that's bullshit so I am posting it here. Come at me.
Amazon is a SOA system with 100s of services (or so says Amazon Chief Technology Officer Werner Vogels). How do they handle build and release?
/* eslint-disable @typescript-eslint/no-explicit-any */ | |
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | |
/* eslint-disable @typescript-eslint/explicit-function-return-type */ | |
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | |
// @ts-nocheck | |
import { Model, Page, QueryBuilder } from 'objection'; | |
type Options = { | |
columnName?: string; |
import { Client, ServiceError, Metadata, CallOptions, ClientUnaryCall } from '@grpc/grpc-js'; | |
import { Message } from 'google-protobuf'; | |
type OriginalCall<T, U> = (request: T, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError, res: U) => void) => ClientUnaryCall; | |
type PromisifiedCall<T, U> = ((request: T, metadata?: Metadata, options?: Partial<CallOptions>) => Promise<U>); | |
export type Promisified<C> = { $: C; } & { | |
[prop in Exclude<keyof C, keyof Client>]: (C[prop] extends OriginalCall<infer T, infer U> ? PromisifiedCall<T, U> : never); | |
} |
https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff
While attempting to explain JavaScript's reduce
method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.
JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List
is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu
A description of known problems in Satoshi Nakamoto's paper, "Bitcoin: A Peer-to-Peer Electronic Cash System", as well as notes on terminology changes and how Bitcoin's implementation differs from that described in the paper.
The longest chain not only serves as proof of the sequence of events witnessed, but proof that it came from the largest pool of CPU power.