Skip to content

Instantly share code, notes, and snippets.

@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;
class Front {
async initialize() {
throw new Error("initialize Mandatory");
}
static async createFront() {
const front = new this();
await front.initialize();
return front;
}
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const {
DEBUG_TARGETS,
REQUEST_WORKERS_SUCCESS,
SERVICE_WORKER_FETCH_STATES,