This file contains hidden or 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
[alias] | |
wip = log --graph --rev=wip --template=wip | |
[revsetalias] | |
wip = (parents(not public()) or not public() or . or (head() and branch(default))) and (not obsolete() or orphan()^) and not closed() and not (fxheads() - date(-90)) | |
ignored_changesets = desc("ignore-this-changeset") or extdata(get_ignored_changesets) | |
[templates] | |
wip = '{ | |
label( |
This file contains hidden or 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
// Evaluate the following in Firefox Browser Console | |
copy("Not Wordle, just my #firefox tabs:\n" + | |
gBrowser.tabs | |
.map(tab => tab.pinned ? `🟪` : tab.getAttribute("pending") ? `🟨` : `🟩` ) | |
.reduce((acc, curr) => { | |
if (acc.at(-1).length == 10) { | |
acc.push(""); | |
} | |
acc[acc.length - 1] += curr; | |
return acc; |
This file contains hidden or 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
prompt_hg() { | |
local HG_ROOT | |
find_hg_root() { | |
local dir="$( pwd )" | |
while test $dir != "/"; do | |
if test -f $dir'/.hg/dirstate'; then | |
HG_ROOT=$dir"/.hg" | |
return 0 | |
fi |
This file contains hidden or 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
// With the console open, in the browser console: | |
async function getOpenedConsoleReference() { | |
var {devtools} = Cu.import("resource://devtools/shared/Loader.jsm", {}); | |
var target = await devtools.TargetFactory.forTab(gBrowser.selectedTab); | |
var {gDevTools} = devtools.require("devtools/client/framework/devtools"); | |
var toolbox = gDevTools.getToolbox(target); | |
return toolbox.getCurrentPanel(); | |
} |
This file contains hidden or 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
// With the console open, in the browser console: | |
async function getOpenedConsoleReference() { | |
var loader = Cu.import("resource://devtools/shared/Loader.jsm", {}); | |
var {gDevTools} = loader.require("devtools/client/framework/devtools"); | |
var target = await gDevTools.getTargetForTab(gBrowser.selectedTab); | |
var toolbox = gDevTools.getToolbox(target); | |
return toolbox.getCurrentPanel(); | |
} |
This file contains hidden or 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
git push [email protected]:user/repo local_branch_name:remote_branch_name |
This file contains hidden or 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
var index = 0; | |
var nodes = document.querySelectorAll(".tree-node"); | |
function scrollNext() { | |
index = index + 40; | |
nodes[index].scrollIntoView(); | |
if (index < nodes.length - 1) { | |
requestAnimationFrame(scrollNext); | |
} | |
} | |
scrollNext(); |
This file contains hidden or 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
let canvas = window.document.createElementNS("http://www.w3.org/1999/xhtml", "html:canvas"); | |
let context = canvas.getContext("2d"); | |
canvas.width = window.innerWidth; | |
canvas.height = window.innerHeight; | |
context.drawWindow(window, 0, 0, canvas.width, canvas.height, "white"); | |
console.log(` | |
📸 📸 📸 📸 | |
${canvas.toDataURL()} |
This file contains hidden or 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
let [a, b] = (new Array(2)).fill(Symbol()); | |
console.log(a === b); // -> true |
This file contains hidden or 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
/** | |
* Utility function to create DOM element with populated attributes and content | |
* | |
* Usage : | |
* | |
* // simple element | |
* let input = createDomElement("input", { | |
* type: "search", | |
* placeholder: "Enter what pleases you" | |
* }); |
NewerOlder