Skip to content

Instantly share code, notes, and snippets.

@juliandescottes
juliandescottes / debugger-html_create-compare-url.js
Created January 3, 2018 10:56
Create debugger html compare URL
async function createCompareURL(attachmentUrl) {
let attachment = await fetch(attachmentUrl);
let patch = await attachment.text();
let oldHash = patch.match(/\-Taken from upstream commit: ([a-f0-9]+)\n/)[1];
let newHash = patch.match(/\+Taken from upstream commit: ([a-f0-9]+)\n/)[1];
let compareUrl =
`https://github.com/devtools-html/debugger.html/compare/${oldHash}...${newHash}`;
console.log(compareUrl);
}
@dhh
dhh / linux-setup.sh
Last active April 26, 2024 22:57
linux-setup.sh
# CLI
sudo apt update -y
sudo apt install -y \
git curl docker.io \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils
@jacobw
jacobw / dev4.yaml
Created April 26, 2024 22:40
ESPHOME BTHome
esphome:
name: dev4
friendly_name: BTHome dev4
interval:
- interval: 5s
startup_delay: 1s
then:
- lambda: |-
// Update sensor then wait
@juliandescottes
juliandescottes / hack-devtools-57-outline.md
Last active April 26, 2024 22:57
Hacks post 57 outline

INTRO

GENERAL

  • new colors, photon update

INSPECTOR

  • Layout panel, grid inspector improvements
  • Layout panel, box model information
  • toggle class elements
@juliandescottes
juliandescottes / devtools_addon_tests.txt
Created August 9, 2017 13:48
DevTools as System Addon tests
(DSA = DevTools as System Addon)
Setup: The version of DevTools as system addon that I am testing is:
- the patches from ship as system addon https://bugzilla.mozilla.org/show_bug.cgi?id=1369801
- the patches from move key-shortcut https://bugzilla.mozilla.org/show_bug.cgi?id=1386616
- the "workaround" from system addons sideloaded don't start https://bugzilla.mozilla.org/show_bug.cgi?id=1386295
Test scenarios
- S1:
1 - Open Firefox with DSA with a clean profile
function getRandomColor() {
var letters = '0123456789ABCDEF';
var color = '#';
for (var i = 0; i < 6; i++ ) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
@juliandescottes
juliandescottes / _devtools_computed_selection.js
Created January 16, 2017 15:10
Some random code to inspect the selection in the computed view
let win = this.styleWindow;
let selection = win.getSelection();
let computedViewRanges = [];
for (let i = 0; i < selection.rangeCount; i++) {
let range = selection.getRangeAt(i);
if (!range.collapsed) {
let ancestor = range.commonAncestorContainer;
if (this.element == ancestor || this.element.contains(ancestor)) {
console.log("valid range", range);
computedViewRanges.push(range);
<div class="dialog-wrapper">
<h3 class="dialog-head">Set layer opacity<span class="dialog-close">X</span>
</h3>
<div class="dialog-content" style="padding:10px 20px; font-size:1.5em; overflow: auto;">
<div>Set opacity for <b>Layer 1</b></div>
<div style="
margin-top: 10px;
/* float: right; */
display: inline-block;