Moved to skeeto/scratch/aidrivers
any
: magic, ill-behaved type that acts like a combination ofnever
(the proper [bottom type]) andunknown
(the proper [top type])- Anything except
never
is assignable toany
, andany
is assignable to anything at all. - Identities:
any & AnyTypeExpression = any
,any | AnyTypeExpression = any
- Key TypeScript feature that allows for [gradual typing].
- Anything except
unknown
: proper, well-behaved [top type]- Anything at all is assignable to
unknown
.unknown
is only assignable to itself (unknown
) andany
. - Identities:
unknown & AnyTypeExpression = AnyTypeExpression
,unknown | AnyTypeExpression = unknown
- Anything at all is assignable to
- Prefer over
any
whenever possible. Anywhere in well-typed code you're tempted to useany
, you probably wantunknown
.
This file contains 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 is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any | |
means. | |
In jurisdictions that recognize copyright laws, the author or authors | |
of this software dedicate any and all copyright interest in the | |
software to the public domain. We make this dedication for the benefit |
This file contains 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
-- Function to automatically create a user_id column for new tables with name starting with user_ | |
create or replace function create_user_id_column() | |
returns event_trigger | |
language plpgsql volatile as | |
$$ | |
declare | |
obj record; | |
identity text[]; | |
begin | |
for obj in select * from pg_event_trigger_ddl_commands() |
This file contains 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
#!/bin/bash | |
## | |
## olyWifiSync - Mirror Olympus camera via WIFI | |
## | |
## Usage: olyWifiSync [-d|-n|-f|-p|-h] ESSID PASSWORD [wifidevice] | |
## -d download only, don't try to configure the WIFI device) | |
## -n no disconnect, do not disconnect the WIFI on completion | |
## -f full download, do not skip over files that already exist | |
## -p power off camera at end of transfer | |
## -h help |
The purpose of this document is to explain how to deploy an Upspin server on a Debian or Ubuntu based machine - which can be a Raspberry Pi - and, optionally, use Google Drive to back the data.
Effectively, this will give you all the nifty advantages Upspin gives you in terms of file sharing without requiring a costly server.
This file contains 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
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" |
- A
secret
byte you want to read is stored at inaccessible memory locationpriv_mem
. - The sender triggers an access exception by attempting to read
priv_mem
. - Due to CPU optimization (out-of-order execution), the load of
secret
frompriv_mem
and the use of its value in (4) and (5) below may execute before the exception is triggered. - Calculate an
offset
into a known arrayprobe
by multiplyingsecret
by the width of a cache line (or whatever block size the CPU typically fetches, like a 4096-byte page). This guarantees each of those 256 possible offsets will cache separately. - Load
probe[offset]
, which causes the CPU to cache exactly one chunk of of our array, populating one cache line. - The exception finally triggers, clearing the modified registers...but cached data is not excised.
- Iterate over all 256 offsets into
probe
to find out which one loads fast. You've determined the value ofsecret
.
NewerOlder