CLICK ME
yes, even hidden code blocks!
print("hello world!")
ℹ️ Enable iCloud end-to-end encryption:
System settings
→ Apple ID
→ iCloud
→ Set Advanced Data Protection
to On
.System settings
→ Apple ID
→ iCloud
→ Disable Access iCloud Data on the Web
./** | |
* Returns a Time Sortable ID with millisecond precision. | |
* | |
* Time component: 42 bits (2^42 = ~69 years) | |
* | |
* Random component: 22 bits (2^22 = 4,194,304) | |
* | |
* The time component is the count of milliseconds since 2020-01-01T00:00:00Z. | |
* | |
* Tags: tsid ulid snowflake id-generator generator time sortable sort order id |
-- Based off IETF draft, https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/ | |
create or replace function uuid_generate_v7() | |
returns uuid | |
as $$ | |
begin | |
-- use random v4 uuid as starting point (which has the same variant we need) | |
-- then overlay timestamp | |
-- then set version 7 by flipping the 2 and 1 bit in the version 4 string | |
return encode( |
Zig aims to be a simple language. It is not easy to define what simple exactly means, but zig is also a low-level programming language that aims for c-compatibility. To reach this goal, it needs good semantics in its type system so that developers have a complete toolbox to manipulate data.
So types in zig are composable, but this can become rapidly overwhelming. See those examples. Are you able to understand them at a glance, as soon as you read them?
*const ?u8
?*const u8
*const [2]u8
I get asked pretty regularly what my opinion is on merge commits vs rebasing vs squashing. I've typed up this response so many times that I've decided to just put it in a gist so I can reference it whenever it comes up again.
I use merge, squash, rebase all situationally. I believe they all have their merits but their usage depends on the context. I think anyone who says any particular strategy is the right answer 100% of the time is wrong, but I think there is considerable acceptable leeway in when you use each. What follows is my personal and professional opinion:
This setup uses some tricks to ensure that the right email/name/ssh-key is used for the right repos without having to think about it ever again.
~/.ssh/id_ed25519
and ~/.ssh/id_ed25519_work
Example of how to capture CPU counters with ETW on Windows, perf on Linux or kperf on Apple.
Using ETW needs somewhat recently updated Windows 10 or 11. Not sure about exact version.
Currently tested on:
#!/bin/bash | |
# Function to display usage information | |
usage() { | |
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]" | |
exit 1 | |
} | |
# Check if at least one argument (input file) is provided | |
if [ $# -lt 1 ]; then |
# add node_modules to $PATH | |
export PATH := justfile_directory() + "/node_modules/.bin:" + env_var('PATH') | |
# first recipe is always default - list these rules | |
default: | |
@just --list | |
# everything ok? good to run before commit | |
check: | |
@for i in tsc lint test vitest; do \ |