async function thrower() {
throw new Error('error')
}
async function A() {
return thrower()
}
async function B() {
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDro2WC5iqnDLmQhFChzObbylQ4gGbOMQLMlUMchgTNKeM1hiBlQ7Xg5NNTQuHpFNWTbhYeuhW+idWVPHThZRf28sDcXQFDQYjSu0kFBeFH2sQU7S1Aj9ioYdQF2z3wY/2yCM18W4JbS/WX94LrqBIMjo0Bm/JCwZTM8KJFAlQ68Re4XHhQ6XVu+2kqeqVveyl+lFi30KoVv2ArjdC0V/BJMQVKCZ/CNLxeaND2Mxgo3cjpFhY700Xq1vIEBEJ+dR6gXCDttbRE/q7But3+84Dcm4fa+wbOGQSWxZRTY8DFRBEYclftCNtlvLqDVo42xy5xFbuOshaVZI5lpY7Gh0XVbc/I22ALs/08Ic1Tz6ZUj5W4H6lyusPCmkL0AXBg9i+SK1Goqg+38Ztdp1Y2PYsxZudwM70jllGNMASedVy5qzYljxj1AkNEGkb+CSzhMeu4l/uifMx54bjKNbOc71pZtnF39ds+VW1Je60sRsAzz210zcy0mSdGdXUP5ON6ylc= mrobertevers |
function _map1(arr) { | |
return arr.reduce((acc, item) => { | |
acc[item] = item | |
return acc | |
}, {}) | |
} | |
function _map2(arr) { | |
return arr.reduce((acc, item) => ({ ...acc, [item]: item }), {}) | |
} |
Careful when putting IFrames in modals. If the modal is otherwise invisible and has pointer-events: none, the iframe will still capture events. The Iframe is capturing pointer events even though a parent div has "pointer-events: none"...
Chromium says that this works as intended 12:00 https://bugs.chromium.org/p/chromium/issues/detail?id=451929 12:01 "Iframes" aren't the target of tap/touch events, so 'pointer-events: none' doesn't apply to them. Then I guess Mozilla disagrees or this is a bug in Firefox? TIL
``` | |
# -lstdc++ links against the cpp std lib | |
# -framework Foundation includes the Objective c(pp) foundation | |
# -fobjc-arc Enables ARC | |
clang -lstdc++ -framework Foundation -fobjc-arc main.mm -o hello | |
./hello | |
``` | |
```objective-c |
I've been thinking about a way to write code that is both dependency free and blocking free for several use cases. (A serial protocol for example)
I've seen solutions where the dependencies are injected into the library code, and the library calls the dependency that way, but if the library is expecting polling, or blocking behavior, that isn't good. E.g. If a uart driver needs a delay(ms)
function, that's bad; I don't want the uart driver to block.
Instead, I imagine the library code to return instructions back to the app code, describing what the app should do. (redux-saga for react does something like this, where they return 'effects' - I like that)
So instead of the library code blocking with the delay function - return an 'effect' (stealing redux-saga terms) describing how long to wait. TASK_WAIT_10MS
or something like that. It doesn't have to be the returned value, but the idea is that the library code communicates what it needs from the user.
I thought it was weird that some software/libs/frameworks take executable code as config, but I recently read a blog talking about DSLs and config files with conditionals and statements.
It talked about how certain programs provide a DSL in their yaml configs (obviously in-house for each program). These DSLs are not portable because every system rolls their own.
Article here, https://blog.earthly.dev/intercal-yaml-and-other-horrible-programming-languages/
For example, Webpack can take config as an executable javascript file. I always thought that was weird (not bad), but I think I much prefer it to a DSL embedded in yaml or JSON.
I was trying to understand the clocking mechanism in the stm32l0 (among other stms). I was trying to figure out how I would know to enable, e.g. __HAL_RCC_GPIOA_CLK_ENABLE
when modifying certain registers.
I found the answer in memory map section, which specifies which peripheral each memory mapped region belongs. Turns out GPIOH is its own peripheral, (I assume, although not explicitly stated, that 'GPIOH' is the peripheral that handles the multiplexing of physical pins.)
Copied from section 2.2.2 of Stm32l0x reference manual.
Memory map and register boundary addresses
See the datasheet corresponding to your device for a comprehensive diagram of the