Skip to content

Instantly share code, notes, and snippets.

@bwrrp
bwrrp / Dockerfile
Last active February 5, 2024 12:29
Visual Studio Code development container for the ESP-IDF
FROM espressif/idf:v4.2
RUN echo "source /opt/esp/idf/export.sh" >> /root/.bashrc

Keybase proof

I hereby claim:

  • I am bwrrp on github.
  • I am bwrrp (https://keybase.io/bwrrp) on keybase.
  • I have a public key whose fingerprint is CE94 22FA B497 A643 8378 E67A 0F56 5C57 2752 D7C8

To claim this, I am signing this object:

@bwrrp
bwrrp / in-window.html
Created February 28, 2015 18:59
Reproducible case for Firefox window.open / window.location error.
<!doctype html>
<html>
<body>
<script>
try {
location.replace(location.href + '#/route'); // crash
//location.href += '#/route'; // crash
//location.href = 'http://www.mozilla.org/'; // allowed
//location.hash = '#/route'; // allowed
} catch (error) {
@bwrrp
bwrrp / README.md
Last active August 29, 2015 14:02
Proof of concept: stretchable inline elements by abusing the browser selection

Stretchable inlines

This is a proof of concept of abusing the browser selection to make inline elements stretchable by the user. Inline handles (span elements) are added to each stretchable inline. We then hook up a set of mousedown / move / up event handlers to catch drag operations starting on these handles and reset the selection to cover the entire element, with the focus at the side of the clicked handle. It looks like Chrome and Firefox are quite forgiving and integrate the resulting selection into the one being created by the mouse drag!

IE is, as always, a lot more trouble:

  • It doesn't seem to want to continue selecting after the selection is modified programmatically.
  • It messes up most ways of styling the handles as anything vaguely block-like becomes selectable in IE's "control selection" mode, complete with being draggable and having resize handles, with no way to disable this behavior. Of course this prevents any text selections being created when starting a drag on t